\hypertarget{ml__agent_8c}{}\doxysection{nnstreamer/ml\+\_\+agent.c File Reference}
\label{ml__agent_8c}\index{nnstreamer/ml\_agent.c@{nnstreamer/ml\_agent.c}}


Internal helpers to make a bridge between N\+NS filters and the ML Agent service.  


{\ttfamily \#include $<$json-\/glib/json-\/glib.\+h$>$}\newline
{\ttfamily \#include $<$nnstreamer\+\_\+log.\+h$>$}\newline
{\ttfamily \#include $<$mlops-\/agent-\/interface.\+h$>$}\newline
{\ttfamily \#include \char`\"{}ml\+\_\+agent.\+h\char`\"{}}\newline
Include dependency graph for ml\+\_\+agent.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{ml__agent_8c__incl}
\end{center}
\end{figure}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
gchar $\ast$ \mbox{\hyperlink{ml__agent_8c_aede10f8f3ad168009e3a3ee0828e9148}{mlagent\+\_\+get\+\_\+model\+\_\+path\+\_\+from}} (const G\+Value $\ast$val)
\begin{DoxyCompactList}\small\item\em Get a path of the model file from a given G\+Value. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const gchar \mbox{\hyperlink{ml__agent_8c_a4b6c759a0d77a2856ab975f31572174d}{U\+R\+I\+\_\+\+S\+C\+H\+E\+ME}} \mbox{[}$\,$\mbox{]} = \char`\"{}mlagent\char`\"{}
\item 
const gchar \mbox{\hyperlink{ml__agent_8c_a38fa0b56b79bb6748e16997e41ab0224}{U\+R\+I\+\_\+\+K\+E\+Y\+W\+O\+R\+D\+\_\+\+M\+O\+D\+EL}} \mbox{[}$\,$\mbox{]} = \char`\"{}model\char`\"{}
\item 
const gchar \mbox{\hyperlink{ml__agent_8c_a9030196225eeddbaaf2d6c6074696c80}{J\+S\+O\+N\+\_\+\+K\+E\+Y\+\_\+\+M\+O\+D\+E\+L\+\_\+\+P\+A\+TH}} \mbox{[}$\,$\mbox{]} = \char`\"{}path\char`\"{}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Internal helpers to make a bridge between N\+NS filters and the ML Agent service. 

Copyright (C) 2023 Wook Song \href{mailto:wook16.song@samsung.com}{\texttt{ wook16.\+song@samsung.\+com}} Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved.

\begin{DoxyDate}{Date}
23 Jun 2023 
\end{DoxyDate}
\begin{DoxySeeAlso}{See also}
\href{http://github.com/nnstreamer/nnstreamer}{\texttt{ http\+://github.\+com/nnstreamer/nnstreamer}} 
\end{DoxySeeAlso}
\begin{DoxyAuthor}{Author}
wook16.\+song \href{mailto:wook16.song@samsung.com}{\texttt{ wook16.\+song@samsung.\+com}} 
\end{DoxyAuthor}
\begin{DoxyRefDesc}{Bug}
\item[\mbox{\hyperlink{bug__bug000085}{Bug}}]No known bugs except for N\+YI items \end{DoxyRefDesc}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{ml__agent_8c_aede10f8f3ad168009e3a3ee0828e9148}\label{ml__agent_8c_aede10f8f3ad168009e3a3ee0828e9148}} 
\index{ml\_agent.c@{ml\_agent.c}!mlagent\_get\_model\_path\_from@{mlagent\_get\_model\_path\_from}}
\index{mlagent\_get\_model\_path\_from@{mlagent\_get\_model\_path\_from}!ml\_agent.c@{ml\_agent.c}}
\doxysubsubsection{\texorpdfstring{mlagent\_get\_model\_path\_from()}{mlagent\_get\_model\_path\_from()}}
{\footnotesize\ttfamily gchar$\ast$ mlagent\+\_\+get\+\_\+model\+\_\+path\+\_\+from (\begin{DoxyParamCaption}\item[{const G\+Value $\ast$}]{val }\end{DoxyParamCaption})}



Get a path of the model file from a given G\+Value. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em val} & A pointer to a G\+Value holding a G\+\_\+\+T\+Y\+P\+E\+\_\+\+S\+T\+R\+I\+NG value \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A newly allocated c-\/string representing the model file path, if the given G\+Value contains a valid U\+RI Otherwise, it simply returns a duplicated (strdup\textquotesingle{}ed) c-\/string that the val contains. 
\end{DoxyReturn}
\begin{DoxyNote}{Note}
The caller should free the return c-\/string after using it. 
\end{DoxyNote}
Common checker for the given U\+RI

\begin{DoxyNote}{Note}
Only for the following U\+RI formats to get the file path of the matching models are currently supported. mlagent\+://model/name or mlagent\+://model/name/version
\end{DoxyNote}
It is required to be revised to support more scenarios that exploit the ML Agent.

Convert the given U\+RI for a model to the file path

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000043}{Todo}}]The specification of the data layout filled in the third argument (i.\+e., stringified\+\_\+json) by the callee is not fully decided. \end{DoxyRefDesc}


\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000044}{Todo}}]Parse stringified\+\_\+json to get the model\textquotesingle{}s path \end{DoxyRefDesc}


Definition at line 33 of file ml\+\_\+agent.\+c.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{ml__agent_8c_aede10f8f3ad168009e3a3ee0828e9148_icgraph}
\end{center}
\end{figure}


\doxysubsection{Variable Documentation}
\mbox{\Hypertarget{ml__agent_8c_a9030196225eeddbaaf2d6c6074696c80}\label{ml__agent_8c_a9030196225eeddbaaf2d6c6074696c80}} 
\index{ml\_agent.c@{ml\_agent.c}!JSON\_KEY\_MODEL\_PATH@{JSON\_KEY\_MODEL\_PATH}}
\index{JSON\_KEY\_MODEL\_PATH@{JSON\_KEY\_MODEL\_PATH}!ml\_agent.c@{ml\_agent.c}}
\doxysubsubsection{\texorpdfstring{JSON\_KEY\_MODEL\_PATH}{JSON\_KEY\_MODEL\_PATH}}
{\footnotesize\ttfamily const gchar J\+S\+O\+N\+\_\+\+K\+E\+Y\+\_\+\+M\+O\+D\+E\+L\+\_\+\+P\+A\+TH\mbox{[}$\,$\mbox{]} = \char`\"{}path\char`\"{}}



Definition at line 23 of file ml\+\_\+agent.\+c.

\mbox{\Hypertarget{ml__agent_8c_a38fa0b56b79bb6748e16997e41ab0224}\label{ml__agent_8c_a38fa0b56b79bb6748e16997e41ab0224}} 
\index{ml\_agent.c@{ml\_agent.c}!URI\_KEYWORD\_MODEL@{URI\_KEYWORD\_MODEL}}
\index{URI\_KEYWORD\_MODEL@{URI\_KEYWORD\_MODEL}!ml\_agent.c@{ml\_agent.c}}
\doxysubsubsection{\texorpdfstring{URI\_KEYWORD\_MODEL}{URI\_KEYWORD\_MODEL}}
{\footnotesize\ttfamily const gchar U\+R\+I\+\_\+\+K\+E\+Y\+W\+O\+R\+D\+\_\+\+M\+O\+D\+EL\mbox{[}$\,$\mbox{]} = \char`\"{}model\char`\"{}}



Definition at line 22 of file ml\+\_\+agent.\+c.

\mbox{\Hypertarget{ml__agent_8c_a4b6c759a0d77a2856ab975f31572174d}\label{ml__agent_8c_a4b6c759a0d77a2856ab975f31572174d}} 
\index{ml\_agent.c@{ml\_agent.c}!URI\_SCHEME@{URI\_SCHEME}}
\index{URI\_SCHEME@{URI\_SCHEME}!ml\_agent.c@{ml\_agent.c}}
\doxysubsubsection{\texorpdfstring{URI\_SCHEME}{URI\_SCHEME}}
{\footnotesize\ttfamily const gchar U\+R\+I\+\_\+\+S\+C\+H\+E\+ME\mbox{[}$\,$\mbox{]} = \char`\"{}mlagent\char`\"{}}



Definition at line 21 of file ml\+\_\+agent.\+c.

