Doxygen Book
ml_agent.c File Reference

Internal helpers to make a bridge between NNS filters and the ML Agent service. More...

#include <json-glib/json-glib.h>
#include <nnstreamer_log.h>
#include <mlops-agent-interface.h>
#include "ml_agent.h"
Include dependency graph for ml_agent.c:

Go to the source code of this file.

Functions

gchar * mlagent_get_model_path_from (const GValue *val)
 Get a path of the model file from a given GValue. More...
 

Variables

const gchar URI_SCHEME [] = "mlagent"
 
const gchar URI_KEYWORD_MODEL [] = "model"
 
const gchar JSON_KEY_MODEL_PATH [] = "path"
 

Detailed Description

Internal helpers to make a bridge between NNS filters and the ML Agent service.

Copyright (C) 2023 Wook Song wook1.nosp@m.6.so.nosp@m.ng@sa.nosp@m.msun.nosp@m.g.com Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved.

Date
23 Jun 2023
See also
http://github.com/nnstreamer/nnstreamer
Author
wook16.song wook1.nosp@m.6.so.nosp@m.ng@sa.nosp@m.msun.nosp@m.g.com
Bug:
No known bugs except for NYI items

Definition in file ml_agent.c.

Function Documentation

◆ mlagent_get_model_path_from()

gchar* mlagent_get_model_path_from ( const GValue *  val)

Get a path of the model file from a given GValue.

Parameters
[in]valA pointer to a GValue holding a G_TYPE_STRING value
Returns
A newly allocated c-string representing the model file path, if the given GValue contains a valid URI Otherwise, it simply returns a duplicated (strdup'ed) c-string that the val contains.
Note
The caller should free the return c-string after using it.

Common checker for the given URI

Note
Only for the following URI formats to get the file path of the matching models are currently supported. mlagent://model/name or mlagent://model/name/version

It is required to be revised to support more scenarios that exploit the ML Agent.

Convert the given URI for a model to the file path

Todo:
The specification of the data layout filled in the third argument (i.e., stringified_json) by the callee is not fully decided.
Todo:
Parse stringified_json to get the model's path

Definition at line 33 of file ml_agent.c.

Here is the caller graph for this function:

Variable Documentation

◆ JSON_KEY_MODEL_PATH

const gchar JSON_KEY_MODEL_PATH[] = "path"

Definition at line 23 of file ml_agent.c.

◆ URI_KEYWORD_MODEL

const gchar URI_KEYWORD_MODEL[] = "model"

Definition at line 22 of file ml_agent.c.

◆ URI_SCHEME

const gchar URI_SCHEME[] = "mlagent"

Definition at line 21 of file ml_agent.c.