From: Dongju Chae Date: Mon, 2 Dec 2019 10:19:10 +0000 (+0900) Subject: [PROP] Add new tensor filter prop to indicate a model is updatable X-Git-Tag: accepted/tizen/unified/20191204.042059~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d780ed533c22de66f30314b2aaa9cd0c295a846b;p=platform%2Fupstream%2Fnnstreamer.git [PROP] Add new tensor filter prop to indicate a model is updatable This commit adds new tensor filter property to indicate a given model to a tensor filter is updatable or not. The default value is False. Signed-off-by: Dongju Chae --- diff --git a/gst/nnstreamer/tensor_filter/tensor_filter_common.c b/gst/nnstreamer/tensor_filter/tensor_filter_common.c index e11ae1d..e8d4592 100644 --- a/gst/nnstreamer/tensor_filter/tensor_filter_common.c +++ b/gst/nnstreamer/tensor_filter/tensor_filter_common.c @@ -65,7 +65,8 @@ enum PROP_OUTPUTNAME, PROP_CUSTOM, PROP_SUBPLUGINS, - PROP_ACCELERATOR + PROP_ACCELERATOR, + PROP_UPDATABLE_MODEL, }; /** @@ -321,6 +322,11 @@ gst_tensor_filter_install_properties (GObjectClass * gobject_class) "list of accelerators determines the backend (ignored with false). " "Example, if GPU, NPU can be used but not CPU - true:(GPU,NPU,!CPU).", "", G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_UPDATABLE_MODEL, + g_param_spec_string ("is-updatable", "Updatable model", + "Indicate whether a given model to this tensor filter is " + "updatable in runtime. (e.g., with on-device training)", + FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } /** @@ -606,6 +612,11 @@ gst_tensor_filter_common_set_property (GstTensorFilterPrivate * priv, break; } + case PROP_UPDATABLE_MODEL: + { + priv->updatable_model = g_value_get_boolean (value); + break; + } default: return FALSE; } @@ -755,6 +766,9 @@ gst_tensor_filter_common_get_property (GstTensorFilterPrivate * priv, g_value_set_string (value, ""); } break; + case PROP_UPDATABLE_MODEL: + g_value_set_boolean (value, priv->updatable_model); + break; default: /* unknown property */ return FALSE; diff --git a/gst/nnstreamer/tensor_filter/tensor_filter_common.h b/gst/nnstreamer/tensor_filter/tensor_filter_common.h index 9b46770..8ec66bc 100644 --- a/gst/nnstreamer/tensor_filter/tensor_filter_common.h +++ b/gst/nnstreamer/tensor_filter/tensor_filter_common.h @@ -41,6 +41,7 @@ typedef struct _GstTensorFilterPrivate /* internal properties for tensor-filter */ gboolean silent; /**< Verbose mode if FALSE. int instead of gboolean for non-glib custom plugins */ gboolean configured; /**< True if already successfully configured tensor metadata */ + gboolean updatable_model; /**< a given model to the filter is updatable if TRUE */ GstTensorsConfig in_config; /**< input tensor info */ GstTensorsConfig out_config; /**< output tensor info */ } GstTensorFilterPrivate;