[PROP] Add new tensor filter prop to indicate a model is updatable
authorDongju Chae <dongju.chae@samsung.com>
Mon, 2 Dec 2019 10:19:10 +0000 (19:19 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 3 Dec 2019 10:23:22 +0000 (19:23 +0900)
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 <dongju.chae@samsung.com>
gst/nnstreamer/tensor_filter/tensor_filter_common.c
gst/nnstreamer/tensor_filter/tensor_filter_common.h

index e11ae1d..e8d4592 100644 (file)
@@ -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;
index 9b46770..8ec66bc 100644 (file)
@@ -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;