From: jinhyuck-park Date: Fri, 14 Sep 2018 08:00:59 +0000 (+0900) Subject: [TensorDec] Add initalize function for image labeling data of tensor decoder X-Git-Tag: v0.0.2~95 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc49ed4f6a6e95e0b49358750d9c53e608b45b87;p=platform%2Fupstream%2Fnnstreamer.git [TensorDec] Add initalize function for image labeling data of tensor decoder Add function for image labeling data when initialize tensor decoder Signed-off-by: jinhyuck-park --- diff --git a/gst/tensor_decoder/tensordec.c b/gst/tensor_decoder/tensordec.c index e5ae4d1..6da1926 100644 --- a/gst/tensor_decoder/tensordec.c +++ b/gst/tensor_decoder/tensordec.c @@ -103,26 +103,6 @@ enum }; /** - * @brief Data structure for image labeling info. - */ -typedef struct -{ - gchar *label_path; /**< label file path */ - GList *labels; /**< list of loaded labels */ - guint total_labels; /**< count of labels */ -} Mode_image_labeling; - -/** - * @brief Data structure for tensor decoder image labeling mode. - */ -typedef struct -{ - gint current_label_index; /**< current label index */ - gint new_label_index; /**< new label index */ - Mode_image_labeling image_labeling_info; /**< tflite image labeling mode info */ -} TensorDec_Mode_image_Label; - -/** * @brief Default output type. */ #define DEFAULT_OUTPUT_TYPE OUTPUT_VIDEO @@ -173,6 +153,20 @@ static gboolean gst_tensordec_transform_size (GstBaseTransform * trans, GstCaps * othercaps, gsize * othersize); /** + * @brief initialize data in tensor decoder image labeling info structure. + */ +static void +gst_tensordec_image_labeling_init (TensorDec_Mode_image_Label * + mode_image_label) +{ + mode_image_label->image_labeling_info.label_path = NULL; + mode_image_label->image_labeling_info.labels = NULL; + mode_image_label->image_labeling_info.total_labels = 0; + mode_image_label->current_label_index = 0; + mode_image_label->new_label_index = 0; +} + +/** * @brief Get video caps from tensor config * @param self "this" pointer * @param config tensor config info @@ -452,6 +446,7 @@ gst_tensordec_init (GstTensorDec * self) self->output_type = OUTPUT_VIDEO; self->mode = Mode[0]; gst_tensor_config_init (&self->tensor_config); + gst_tensordec_image_labeling_init (&self->tensordec_mode_image_label); } /** diff --git a/gst/tensor_decoder/tensordec.h b/gst/tensor_decoder/tensordec.h index 092a6ff..05265d9 100644 --- a/gst/tensor_decoder/tensordec.h +++ b/gst/tensor_decoder/tensordec.h @@ -50,6 +50,26 @@ typedef struct _GstTensorDec GstTensorDec; typedef struct _GstTensorDecClass GstTensorDecClass; /** + * @brief Data structure for image labeling info. + */ +typedef struct +{ + gchar *label_path; /**< label file path */ + GList *labels; /**< list of loaded labels */ + guint total_labels; /**< count of labels */ +} Mode_image_labeling; + +/** + * @brief Data structure for tensor decoder image labeling mode. + */ +typedef struct +{ + gint current_label_index; /**< current label index */ + gint new_label_index; /**< new label index */ + Mode_image_labeling image_labeling_info; /**< tflite image labeling mode info */ +} TensorDec_Mode_image_Label; + +/** * @brief Internal data structure for tensordec instances. */ struct _GstTensorDec @@ -66,6 +86,7 @@ struct _GstTensorDec /** For Tensor */ gboolean configured; /**< TRUE if already successfully configured tensor metadata */ GstTensorConfig tensor_config; /**< configured tensor info */ + TensorDec_Mode_image_Label tensordec_mode_image_label;/** tensor decoder image labeling mode info */ }; /**