Fix mv_{task}_set_model
authorKwanghoon Son <k.son@samsung.com>
Tue, 30 Apr 2024 02:43:27 +0000 (11:43 +0900)
committerKwanghoon Son <k.son@samsung.com>
Mon, 24 Jun 2024 03:53:24 +0000 (03:53 +0000)
- Missing parameter
- Parameter model_name is optional so move to the end of parameter list
- Test created a std::bad_alloc exception problem because structure
model_info was used in several places under the same name.

Change-Id: I8f1a77bfeff724e5405b5ac54eb3bdbe6a3e1b6c
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
24 files changed:
include/mv_face_detection_internal.h
include/mv_facial_landmark_internal.h
include/mv_image_classification_internal.h
include/mv_object_detection_3d_internal.h
include/mv_object_detection_internal.h
include/mv_pose_landmark_internal.h
include/mv_selfie_segmentation_internal.h
mv_machine_learning/common/src/native_capi.cpp
mv_machine_learning/image_classification/src/mv_image_classification.cpp
mv_machine_learning/image_segmentation/src/mv_selfie_segmentation.cpp
mv_machine_learning/landmark_detection/src/mv_facial_landmark.cpp
mv_machine_learning/landmark_detection/src/mv_pose_landmark.cpp
mv_machine_learning/object_detection/src/mv_face_detection.cpp
mv_machine_learning/object_detection/src/mv_object_detection.cpp
mv_machine_learning/object_detection_3d/src/mv_object_detection_3d.cpp
test/testsuites/machine_learning/image_classification/test_image_classification.cpp
test/testsuites/machine_learning/image_classification/test_image_classification_async.cpp
test/testsuites/machine_learning/image_segmentation/test_selfie_segmentation.cpp
test/testsuites/machine_learning/landmark_detection/test_landmark_detection.cpp
test/testsuites/machine_learning/landmark_detection/test_landmark_detection_async.cpp
test/testsuites/machine_learning/object_detection/test_object_detection.cpp
test/testsuites/machine_learning/object_detection/test_object_detection_async.cpp
test/testsuites/machine_learning/object_detection_3d/test_object_detection_3d.cpp
test/testsuites/machine_learning/task_model_info.hpp [new file with mode: 0644]

index be13732729750052a56063983d8e5d7d015fc562..afef3d7d3ae3a2dd5ec66a943b07b91b6179d3f1 100644 (file)
@@ -43,10 +43,10 @@ extern "C" {
  * @since_tizen 9.0
  *
  * @param[in] handle        The handle to the face detection object.
- * @param[in] model_name    Model name.
  * @param[in] model_file    Model file name.
  * @param[in] meta_file     Model meta file name.
  * @param[in] label_file    Label file name.
+ * @param[in] model_name    Model name.
  *
  * @return @c 0 on success, otherwise a negative error value
  * @retval #MEDIA_VISION_ERROR_NONE Successful
@@ -55,8 +55,8 @@ extern "C" {
  *
  * @pre Create a face detection handle by calling @ref mv_face_detection_create()
  */
-int mv_face_detection_set_model(mv_face_detection_h handle, const char *model_name, const char *model_file,
-                                                               const char *meta_file, const char *label_file);
+int mv_face_detection_set_model(mv_face_detection_h handle, const char *model_file, const char *meta_file,
+                                                               const char *label_file, const char *model_name);
 
 /**
  * @internal
index cbf9651adf57e77b3c0eb37ba35ea519a5f4e6ab..bb9088a0c4ac59669120b5ec7c2eeaf1f45a2725 100644 (file)
@@ -43,10 +43,10 @@ extern "C" {
  * @since_tizen 9.0
  *
  * @param[in] handle        The handle to the facial landmark object.
- * @param[in] model_name    Model name.
  * @param[in] model_file    Model file name.
  * @param[in] meta_file     Model meta file name.
  * @param[in] label_file    Label file name.
+ * @param[in] model_name    Model name.
  *
  * @return @c 0 on success, otherwise a negative error value
  * @retval #MEDIA_VISION_ERROR_NONE Successful
@@ -55,8 +55,8 @@ extern "C" {
  *
  * @pre Create a facial landmark handle by calling @ref mv_facial_landmark_create()
  */
-int mv_facial_landmark_set_model(mv_facial_landmark_h handle, const char *model_name, const char *model_file,
-                                                                const char *meta_file, const char *label_file);
+int mv_facial_landmark_set_model(mv_facial_landmark_h handle, const char *model_file, const char *meta_file,
+                                                                const char *label_file, const char *model_name);
 
 /**
  * @internal
index 442b3f86b0139b02003bdfbe5396c95109b2fd96..af7030a66df6790df9885286eeb69e6d2a5cc592 100644 (file)
@@ -34,6 +34,7 @@ extern "C" {
         * @param[in] model_file    Model file name.
         * @param[in] meta_type     Model meta file name.
         * @param[in] label_file    Label file name.
+        * @param[in] model_name    Model name.
         *
         * @return @c 0 on success, otherwise a negative error value
         * @retval #MEDIA_VISION_ERROR_NONE Successful
@@ -43,7 +44,7 @@ extern "C" {
         * @pre Create a image classification handle by calling @ref mv_image_classification_create()
         */
 int mv_image_classification_set_model(mv_image_classification_h handle, const char *model_file, const char *meta_file,
-                                                                         const char *label_file);
+                                                                         const char *label_file, const char *model_name);
 
 /**
         * @brief Set user-given inference engine and device types for inference.
index 72aa244edc846382a5099ddf6daf665be6d606de..165322ca72d953518bd7ace99958c41a804745b4 100644 (file)
@@ -83,10 +83,10 @@ int mv_object_detection_3d_destroy(mv_object_detection_3d_h handle);
         * @since_tizen 9.0
         *
         * @param[in] handle        The handle to the object detection 3d object.
-        * @param[in] model_name    Model name.
         * @param[in] model_file    Model file name.
         * @param[in] meta_file     Model meta file name.
         * @param[in] label_file    Label file name.
+        * @param[in] model_name    Model name.
         *
         * @return @c 0 on success, otherwise a negative error value
         * @retval #MEDIA_VISION_ERROR_NONE Successful
@@ -95,8 +95,8 @@ int mv_object_detection_3d_destroy(mv_object_detection_3d_h handle);
         *
         * @pre Create a object detection 3d handle by calling @ref mv_object_detection_3d_create()
         */
-int mv_object_detection_3d_set_model(mv_object_detection_3d_h handle, const char *model_name, const char *model_file,
-                                                                        const char *meta_file, const char *label_file);
+int mv_object_detection_3d_set_model(mv_object_detection_3d_h handle, const char *model_file, const char *meta_file,
+                                                                        const char *label_file, const char *model_name);
 
 /**
  * @brief Configures the backend for the object detection inference.
index 80d83f222a08b0360a31b50763b9d21046922e2b..ae8020ce24054d87fb5dc8536f3e96c026f2575d 100644 (file)
@@ -43,10 +43,10 @@ extern "C" {
  * @since_tizen 9.0
  *
  * @param[in] handle        The handle to the object detection object.
- * @param[in] model_name    Model name.
  * @param[in] model_file    Model file name.
  * @param[in] meta_file     Model meta file name.
  * @param[in] label_file    Label file name.
+ * @param[in] model_name    Model name.
  *
  * @return @c 0 on success, otherwise a negative error value
  * @retval #MEDIA_VISION_ERROR_NONE Successful
@@ -55,8 +55,8 @@ extern "C" {
  *
  * @pre Create a object detection handle by calling @ref mv_object_detection_create()
  */
-int mv_object_detection_set_model(mv_object_detection_h handle, const char *model_name, const char *model_file,
-                                                                 const char *meta_file, const char *label_file);
+int mv_object_detection_set_model(mv_object_detection_h handle, const char *model_file, const char *meta_file,
+                                                                 const char *label_file, const char *model_name);
 
 /**
  * @internal
index 9d17dc94281716747e53bcaecae32eabd3072039..563547a4e209bf455dbd3d93ac6f7fe6dc10bca7 100644 (file)
@@ -31,10 +31,10 @@ extern "C" {
  * @since_tizen 9.0
  *
  * @param[in] handle        The handle to the pose landmark object.
- * @param[in] model_name    Model name.
  * @param[in] model_file    Model file name.
  * @param[in] meta_type     Model meta file name.
  * @param[in] label_file    Label file name.
+ * @param[in] model_name    Model name.
  *
  * @return @c 0 on success, otherwise a negative error value
  * @retval #MEDIA_VISION_ERROR_NONE Successful
@@ -43,8 +43,8 @@ extern "C" {
  *
  * @pre Create a pose landmark handle by calling @ref mv_pose_landmark_create()
  */
-int mv_pose_landmark_set_model(mv_pose_landmark_h handle, const char *model_name, const char *model_file,
-                                                          const char *meta_file, const char *label_file);
+int mv_pose_landmark_set_model(mv_pose_landmark_h handle, const char *model_file, const char *meta_file,
+                                                          const char *label_file, const char *model_name);
 
 /**
  * @brief Set user-given backend and device types for inference.
index e83508e9934eb417bf7467b7d6dad69987f9b70e..849015de2f29a53b331e65f7f198cbe4176c1f31 100644 (file)
@@ -87,10 +87,10 @@ int mv_selfie_segmentation_destroy(mv_selfie_segmentation_h handle);
  * @since_tizen 9.0
  *
  * @param[in] handle        The handle to the selfie segmentation object.
- * @param[in] model_name    Model name.
  * @param[in] model_file    Model file name.
  * @param[in] meta_file     Model meta file name.
  * @param[in] label_file    Label file name.
+ * @param[in] model_name    Model name.
  *
  * @return @c 0 on success, otherwise a negative error value
  * @retval #MEDIA_VISION_ERROR_NONE Successful
@@ -99,8 +99,8 @@ int mv_selfie_segmentation_destroy(mv_selfie_segmentation_h handle);
  *
  * @pre Create a selfie segmentation handle by calling @ref mv_selfie_segmentation_create()
  */
-int mv_selfie_segmentation_set_model(mv_selfie_segmentation_h handle, const char *model_name, const char *model_file,
-                                                                        const char *meta_file, const char *label_file);
+int mv_selfie_segmentation_set_model(mv_selfie_segmentation_h handle, const char *model_file, const char *meta_file,
+                                                                        const char *label_file, const char *model_name);
 
 /**
  * @internal
index 5d028b01169d90e67ea35cbf1b4bd071242a499c..ebfba4c4f24baa076e99cd18d63964ee9b0feb0b 100644 (file)
@@ -111,7 +111,10 @@ void machine_learning_native_set_model(void *handle, const string &task_name, co
 {
        auto task = get_task(handle, task_name);
 
-       task->setModelInfo(model_file, meta_file, label_file, model_name);
+       if (model_name)
+               task->setModelInfo(model_file, meta_file, label_file, model_name);
+       else
+               task->setModelInfo(model_file, meta_file, label_file);
 }
 
 void machine_learning_native_set_engine(void *handle, const string &task_name, const char *backend_type,
index b14f2168f00db40e4915fdab58a9905b2cbc0f14..8974e2eaac6c20fcc0012fe5cb7960723aaa2295 100644 (file)
@@ -225,7 +225,7 @@ int mv_image_classification_get_label(mv_image_classification_h handle, unsigned
 }
 
 int mv_image_classification_set_model(mv_image_classification_h handle, const char *model_file, const char *meta_file,
-                                                                         const char *label_file)
+                                                                         const char *label_file, const char *model_name)
 {
        MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
@@ -236,7 +236,7 @@ int mv_image_classification_set_model(mv_image_classification_h handle, const ch
        MEDIA_VISION_FUNCTION_ENTER();
 
        try {
-               machine_learning_native_set_model(handle, TASK_NAME, model_file, meta_file, label_file);
+               machine_learning_native_set_model(handle, TASK_NAME, model_file, meta_file, label_file, model_name);
        } catch (const BaseException &e) {
                LOGE("%s", e.what());
                return e.getError();
index 75b2ecf5dc479d45e084d1fd354751e1cca38638..ad61528ffe6f01094fabfb07c52546ffe687763d 100644 (file)
@@ -86,8 +86,8 @@ int mv_selfie_segmentation_destroy(mv_selfie_segmentation_h handle)
        return MEDIA_VISION_ERROR_NONE;
 }
 
-int mv_selfie_segmentation_set_model(mv_selfie_segmentation_h handle, const char *model_name, const char *model_file,
-                                                                        const char *meta_file, const char *label_file)
+int mv_selfie_segmentation_set_model(mv_selfie_segmentation_h handle, const char *model_file, const char *meta_file,
+                                                                        const char *label_file, const char *model_name)
 {
        MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
@@ -96,7 +96,7 @@ int mv_selfie_segmentation_set_model(mv_selfie_segmentation_h handle, const char
        MEDIA_VISION_FUNCTION_ENTER();
 
        try {
-               machine_learning_native_set_model(handle, TASK_NAME, model_file, meta_file, label_file);
+               machine_learning_native_set_model(handle, TASK_NAME, model_file, meta_file, label_file, model_name);
        } catch (const BaseException &e) {
                LOGE("%s", e.what());
                return e.getError();
index 67c2bc524753734fc324c704e1f3c06b26e27dcf..040473ed3bc8e53bf14123f62979a5c5ede54f6b 100644 (file)
@@ -84,13 +84,12 @@ int mv_facial_landmark_destroy(mv_facial_landmark_h handle)
        return MEDIA_VISION_ERROR_NONE;
 }
 
-int mv_facial_landmark_set_model(mv_facial_landmark_h handle, const char *model_name, const char *model_file,
-                                                                const char *meta_file, const char *label_file)
+int mv_facial_landmark_set_model(mv_facial_landmark_h handle, const char *model_file, const char *meta_file,
+                                                                const char *label_file, const char *model_name)
 {
        MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
-       MEDIA_VISION_INSTANCE_CHECK(model_name);
        MEDIA_VISION_NULL_ARG_CHECK(model_file);
        MEDIA_VISION_NULL_ARG_CHECK(meta_file);
        MEDIA_VISION_NULL_ARG_CHECK(label_file);
index e29551d5e735edb06847c36c98652800eb73e1a1..3c378407921310e97e73a8843bc087bd0c82c033 100644 (file)
@@ -84,13 +84,12 @@ int mv_pose_landmark_destroy(mv_pose_landmark_h handle)
        return MEDIA_VISION_ERROR_NONE;
 }
 
-int mv_pose_landmark_set_model(mv_pose_landmark_h handle, const char *model_name, const char *model_file,
-                                                          const char *meta_file, const char *label_file)
+int mv_pose_landmark_set_model(mv_pose_landmark_h handle, const char *model_file, const char *meta_file,
+                                                          const char *label_file, const char *model_name)
 {
        MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
-       MEDIA_VISION_INSTANCE_CHECK(model_name);
        MEDIA_VISION_NULL_ARG_CHECK(model_file);
        MEDIA_VISION_NULL_ARG_CHECK(meta_file);
        MEDIA_VISION_NULL_ARG_CHECK(label_file);
index d178e6f39657d620e445788e9258f809dfe24f65..99b6f706175926b0d8e4b8abab87b8db344c6b3d 100644 (file)
@@ -84,13 +84,12 @@ int mv_face_detection_destroy(mv_face_detection_h handle)
        return MEDIA_VISION_ERROR_NONE;
 }
 
-int mv_face_detection_set_model(mv_face_detection_h handle, const char *model_name, const char *model_file,
-                                                               const char *meta_file, const char *label_file)
+int mv_face_detection_set_model(mv_face_detection_h handle, const char *model_file, const char *meta_file,
+                                                               const char *label_file, const char *model_name)
 {
        MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
-       MEDIA_VISION_INSTANCE_CHECK(model_name);
        MEDIA_VISION_NULL_ARG_CHECK(model_file);
        MEDIA_VISION_NULL_ARG_CHECK(meta_file);
        MEDIA_VISION_NULL_ARG_CHECK(label_file);
index a9134e2630caf880b2d09744610d595542e3d33d..a437082e8503df45b4f88be198ab473e57d53dd1 100644 (file)
@@ -85,8 +85,8 @@ int mv_object_detection_destroy(mv_object_detection_h handle)
        return MEDIA_VISION_ERROR_NONE;
 }
 
-int mv_object_detection_set_model(mv_object_detection_h handle, const char *model_name, const char *model_file,
-                                                                 const char *meta_file, const char *label_file)
+int mv_object_detection_set_model(mv_object_detection_h handle, const char *model_file, const char *meta_file,
+                                                                 const char *label_file, const char *model_name)
 {
        MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
index 6641376e26cb35496765ed28616b82987ce92fe0..c6301b12f285394cd63e409868a9b00dd856d404 100644 (file)
@@ -89,15 +89,14 @@ int mv_object_detection_3d_destroy(mv_object_detection_3d_h handle)
        return MEDIA_VISION_ERROR_NONE;
 }
 
-int mv_object_detection_3d_set_model(mv_object_detection_3d_h handle, const char *model_name, const char *model_file,
-                                                                        const char *meta_file, const char *label_file)
+int mv_object_detection_3d_set_model(mv_object_detection_3d_h handle, const char *model_file, const char *meta_file,
+                                                                        const char *label_file, const char *model_name)
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
        MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
-       MEDIA_VISION_INSTANCE_CHECK(model_name);
        MEDIA_VISION_NULL_ARG_CHECK(model_file);
        MEDIA_VISION_NULL_ARG_CHECK(meta_file);
        MEDIA_VISION_NULL_ARG_CHECK(label_file);
index 7f495ab71fd445b9bb15f13bb6767d1990645e74..e6cd9e38bfa41d12a6435729dece3cb4cbe22c12 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "gtest/gtest.h"
 
+#include "../task_model_info.hpp"
 #include "ImageHelper.h"
 #include "mv_image_classification.h"
 #include "mv_image_classification_internal.h"
@@ -32,12 +33,6 @@ using namespace std;
 
 using namespace MediaVision::Common;
 
-struct model_info {
-       string model_file;
-       string meta_file;
-       string label_file;
-};
-
 TEST(ImageClassificationTest, GettingAvailableInferenceEnginesInfoShouldBeOk)
 {
        mv_image_classification_h handle;
@@ -88,7 +83,7 @@ TEST(ImageClassificationTest, InferenceShouldBeOk)
 {
        mv_image_classification_h handle;
 
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {}, // If empty then default model will be used.
                { "quant_mobilenet_v1_224x224.tflite", "quant_mobilenet_v1_224x224.json", "ic_mobilenet_v1_label.txt" },
                { "image-classification-001.tflite", "image-classification-001.json", "image-classification-label.txt" },
@@ -114,7 +109,7 @@ TEST(ImageClassificationTest, InferenceShouldBeOk)
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_image_classification_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
-                                                                                               model.label_file.c_str());
+                                                                                               model.label_file.c_str(), NULL);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_image_classification_set_engine(handle, "tflite", "cpu");
index 985d445d044ecfb5d2432415a76a12140e63826f..eb5771221e3f33e8f4e5d81035af0645cbfef00b 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "gtest/gtest.h"
 
+#include "../task_model_info.hpp"
 #include "ImageHelper.h"
 #include "mv_image_classification.h"
 #include "mv_image_classification_internal.h"
@@ -33,13 +34,6 @@ using namespace std;
 
 using namespace MediaVision::Common;
 
-struct model_info {
-       string model_file;
-       string meta_file;
-       string label_file;
-       mv_source_h source;
-};
-
 void image_classification_callback(void *user_data)
 {
        mv_image_classification_h handle = static_cast<mv_image_classification_h>(user_data);
@@ -76,7 +70,7 @@ void image_classification_callback(void *user_data)
 TEST(ImageClassificationAsyncTest, InferenceShouldBeOk)
 {
        mv_image_classification_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {}, // If empty then default model will be used.
                { "quant_mobilenet_v1_224x224.tflite", "quant_mobilenet_v1_224x224.json", "ic_mobilenet_v1_label.txt" },
                { "image-classification-001.tflite", "image-classification-001.json", "image-classification-label.txt" },
@@ -92,7 +86,7 @@ TEST(ImageClassificationAsyncTest, InferenceShouldBeOk)
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_image_classification_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
-                                                                                               model.label_file.c_str());
+                                                                                               model.label_file.c_str(), NULL);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_image_classification_set_engine(handle, "tflite", "cpu");
@@ -114,8 +108,6 @@ TEST(ImageClassificationAsyncTest, InferenceShouldBeOk)
                        ret = ImageHelper::loadImageToSource(IMAGE_PATH, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-                       model.source = mv_source;
-
                        ret = mv_image_classification_inference_async(handle, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
@@ -136,7 +128,7 @@ TEST(ImageClassificationAsyncTest, InferenceShouldBeOk)
 TEST(ImageClassificationAsyncTest, InferenceShouldBeOkWithDestroyFirst)
 {
        mv_image_classification_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {}, // If empty then default model will be used.
                { "quant_mobilenet_v1_224x224.tflite", "quant_mobilenet_v1_224x224.json", "ic_mobilenet_v1_label.txt" },
                { "image-classification-001.tflite", "image-classification-001.json", "image-classification-label.txt" },
@@ -152,7 +144,7 @@ TEST(ImageClassificationAsyncTest, InferenceShouldBeOkWithDestroyFirst)
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_image_classification_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
-                                                                                               model.label_file.c_str());
+                                                                                               model.label_file.c_str(), NULL);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_image_classification_set_engine(handle, "tflite", "cpu");
@@ -174,8 +166,6 @@ TEST(ImageClassificationAsyncTest, InferenceShouldBeOkWithDestroyFirst)
                        ret = ImageHelper::loadImageToSource(IMAGE_PATH, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-                       model.source = mv_source;
-
                        ret = mv_image_classification_inference_async(handle, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
index 543735b243dd90766300c8bca600f2944ac5b637..57b2f5785234e16473d24288ea4ef24c03395207 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "gtest/gtest.h"
 
+#include "../task_model_info.hpp"
 #include "ImageHelper.h"
 
 #include "mv_selfie_segmentation_internal.h"
@@ -35,13 +36,6 @@ using namespace testing;
 using namespace std;
 using namespace MediaVision::Common;
 
-struct model_info {
-       string model_name;
-       string model_file;
-       string meta_file;
-       string label_file;
-};
-
 // Copied from https://docs.opencv.org/4.x/d5/dc4/tutorial_video_input_psnr_ssim.html
 cv::Scalar getMSSIM(const cv::Mat &i1, const cv::Mat &i2)
 {
@@ -85,7 +79,7 @@ cv::Scalar getMSSIM(const cv::Mat &i1, const cv::Mat &i2)
 TEST(ImageSegmentationTest, DISABLED_InferenceShouldBeOk)
 {
        mv_selfie_segmentation_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                { "", "", "", "" } // If empty then default model will be used.
                // TODO.
        };
@@ -103,8 +97,8 @@ TEST(ImageSegmentationTest, DISABLED_InferenceShouldBeOk)
                ret = mv_selfie_segmentation_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_selfie_segmentation_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                          model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_selfie_segmentation_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                          model.label_file.c_str(), NULL);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_selfie_segmentation_set_engine(handle, "tflite", "cpu");
index a60408a52e7165269b7f781c698345f5270602d0..f2f44f7c3d3a894e63221c02e30f54a1b54d6db8 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "gtest/gtest.h"
 
+#include "../task_model_info.hpp"
 #include "ImageHelper.h"
 #include "mv_facial_landmark.h"
 #include "mv_facial_landmark_internal.h"
@@ -34,13 +35,6 @@ using namespace std;
 
 using namespace MediaVision::Common;
 
-struct model_info {
-       string model_name;
-       string model_file;
-       string meta_file;
-       string label_file;
-};
-
 TEST(FacialLandmarkTest, GettingAvailableInferenceEnginesInfoShouldBeOk)
 {
        mv_facial_landmark_h handle;
@@ -90,9 +84,9 @@ TEST(FacialLandmarkTest, GettingAvailableInferenceEnginesInfoShouldBeOk)
 TEST(FacialLandmarkTest, InferenceShouldBeOk)
 {
        mv_facial_landmark_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {}, // If empty then default model will be used.
-               { "FLD_TWEAK_CNN", "fld_tweakcnn_128x128.tflite", "fld_tweakcnn_128x128.json", "" }
+               { "fld_tweakcnn_128x128.tflite", "fld_tweakcnn_128x128.json", "", "FLD_TWEAK_CNN" }
                // TODO.
        };
 
@@ -109,8 +103,8 @@ TEST(FacialLandmarkTest, InferenceShouldBeOk)
                ret = mv_facial_landmark_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_facial_landmark_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                  model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_facial_landmark_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                  model.label_file.c_str(), model.model_name.c_str());
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_facial_landmark_set_engine(handle, "tflite", "cpu");
@@ -203,9 +197,9 @@ TEST(PoseLandmarkTest, GettingAvailableInferenceEnginesInfoShouldBeOk)
 TEST(PoseLandmarkTest, InferenceShouldBeOk)
 {
        mv_pose_landmark_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {}, // If empty then default model will be used.
-               { "PLD_CPM", "pld_cpm_192x192.tflite", "pld_cpm_192x192.json", "" }
+               { "pld_cpm_192x192.tflite", "pld_cpm_192x192.json", "", "PLD_CPM" }
                // TODO.
        };
        const unsigned int coordinate_answers[][10] = { { 300, 300, 275, 250, 325, 325, 225, 225, 350, 375 },
@@ -222,8 +216,8 @@ TEST(PoseLandmarkTest, InferenceShouldBeOk)
                ret = mv_pose_landmark_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_pose_landmark_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_pose_landmark_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                model.label_file.c_str(), model.model_name.c_str());
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_pose_landmark_set_engine(handle, "tflite", "cpu");
index 7ff9a7a881fff96ab1afb5c4cab79db2518dd2fa..5090d5331d91c3371ab9f76dc994a84e2e934de1 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "gtest/gtest.h"
 
+#include "../task_model_info.hpp"
 #include "ImageHelper.h"
 #include "mv_facial_landmark.h"
 #include "mv_facial_landmark_internal.h"
@@ -37,13 +38,6 @@ using namespace std;
 
 using namespace MediaVision::Common;
 
-struct model_info {
-       string model_name;
-       string model_file;
-       string meta_file;
-       string label_file;
-};
-
 void pose_landmark_callback(void *user_data)
 {
        mv_pose_landmark_h handle = static_cast<mv_pose_landmark_h>(user_data);
@@ -85,9 +79,9 @@ void pose_landmark_callback(void *user_data)
 TEST(PoseLandmarkAsyncTest, InferenceShouldBeOk)
 {
        mv_pose_landmark_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {}, // If empty then default model will be used.
-               { "PLD_CPM", "pld_cpm_192x192.tflite", "pld_cpm_192x192.json", "" }
+               { "pld_cpm_192x192.tflite", "pld_cpm_192x192.json", "", "PLD_CPM" }
                // TODO.
        };
 
@@ -95,8 +89,8 @@ TEST(PoseLandmarkAsyncTest, InferenceShouldBeOk)
                int ret = mv_pose_landmark_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_pose_landmark_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_pose_landmark_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                model.label_file.c_str(), model.model_name.c_str());
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_pose_landmark_set_engine(handle, "tflite", "cpu");
@@ -138,9 +132,9 @@ TEST(PoseLandmarkAsyncTest, InferenceShouldBeOk)
 TEST(PoseLandmarkAsyncTest, InferenceShouldBeOkWithDestroyFirst)
 {
        mv_pose_landmark_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {}, // If empty then default model will be used.
-               { "PLD_CPM", "pld_cpm_192x192.tflite", "pld_cpm_192x192.json", "" }
+               { "pld_cpm_192x192.tflite", "pld_cpm_192x192.json", "", "PLD_CPM" }
                // TODO.
        };
 
@@ -148,8 +142,8 @@ TEST(PoseLandmarkAsyncTest, InferenceShouldBeOkWithDestroyFirst)
                int ret = mv_pose_landmark_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_pose_landmark_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_pose_landmark_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                model.label_file.c_str(), model.model_name.c_str());
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_pose_landmark_set_engine(handle, "tflite", "cpu");
@@ -227,9 +221,9 @@ void facial_landmark_callback(void *user_data)
 TEST(FacialLandmarkAsyncTest, InferenceShouldBeOk)
 {
        mv_facial_landmark_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {}, // If empty then default model will be used.
-               { "FLD_TWEAK_CNN", "fld_tweakcnn_128x128.tflite", "fld_tweakcnn_128x128.json", "" }
+               { "fld_tweakcnn_128x128.tflite", "fld_tweakcnn_128x128.json", "", "FLD_TWEAK_CNN" }
                // TODO.
        };
 
@@ -237,8 +231,8 @@ TEST(FacialLandmarkAsyncTest, InferenceShouldBeOk)
                int ret = mv_facial_landmark_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_facial_landmark_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                  model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_facial_landmark_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                  model.label_file.c_str(), model.model_name.c_str());
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_facial_landmark_set_engine(handle, "tflite", "cpu");
@@ -280,9 +274,9 @@ TEST(FacialLandmarkAsyncTest, InferenceShouldBeOk)
 TEST(FacialLandmarkAsyncTest, InferenceShouldBeOkWithDestroyFirst)
 {
        mv_facial_landmark_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                { "", "", "", "" }, // If empty then default model will be used.
-               { "FLD_TWEAK_CNN", "fld_tweakcnn_128x128.tflite", "fld_tweakcnn_128x128.json", "" }
+               { "fld_tweakcnn_128x128.tflite", "fld_tweakcnn_128x128.json", "", "FLD_TWEAK_CNN" }
                // TODO.
        };
 
@@ -290,8 +284,8 @@ TEST(FacialLandmarkAsyncTest, InferenceShouldBeOkWithDestroyFirst)
                int ret = mv_facial_landmark_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_facial_landmark_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                  model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_facial_landmark_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                  model.label_file.c_str(), model.model_name.c_str());
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_facial_landmark_set_engine(handle, "tflite", "cpu");
index 205f5c8c0f03841d4f9cbcee7f9d3829894fbad1..d54eefe79842f32872555a95444667c2c302054c 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "gtest/gtest.h"
 
+#include "../task_model_info.hpp"
 #include "ImageHelper.h"
 #include "mv_face_detection.h"
 #include "mv_face_detection_internal.h"
@@ -34,13 +35,6 @@ using namespace std;
 
 using namespace MediaVision::Common;
 
-struct model_info {
-       string model_name;
-       string model_file;
-       string meta_file;
-       string label_file;
-};
-
 TEST(ObjectDetectionTest, GettingAvailableInferenceEnginesInfoShouldBeOk)
 {
        mv_object_detection_h handle;
@@ -136,7 +130,7 @@ TEST(FaceDetectionTest, GettingAvailableInferenceEnginesInfoShouldBeOk)
 TEST(ObjectDetectionTest, InferenceShouldBeOk)
 {
        mv_object_detection_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {}, // If empty then default model will be used.
                { "mobilenet_v1_ssd", "od_mobilenet_v1_ssd_postop_300x300.tflite", "od_mobilenet_v1_ssd_postop_300x300.json",
                  "od_mobilenet_v1_ssd_postop_label.txt" },
@@ -161,8 +155,8 @@ TEST(ObjectDetectionTest, InferenceShouldBeOk)
                ret = mv_object_detection_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_object_detection_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                       model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_object_detection_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                       model.label_file.c_str(), NULL);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_object_detection_set_engine(handle, "tflite", "cpu");
@@ -208,7 +202,7 @@ TEST(ObjectDetectionTest, InferenceShouldBeOk)
 TEST(FaceDetectionTest, InferenceShouldBeOk)
 {
        mv_object_detection_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {}, // If empty then default model will be used.
                { "fd_mobilenet_v1_ssd", "fd_mobilenet_v1_ssd_postop_300x300.tflite", "fd_mobilenet_v1_ssd_postop_300x300.json",
                  "fd_mobilenet_v1_ssd_postop_label.txt" }
@@ -229,8 +223,8 @@ TEST(FaceDetectionTest, InferenceShouldBeOk)
                ret = mv_face_detection_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_face_detection_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                 model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_face_detection_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                 model.label_file.c_str(), NULL);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_face_detection_set_engine(handle, "tflite", "cpu");
index f6618607184d9a918e40e9f81fc70182080f2e88..94c44246f4e046b39264bf09391ec76b179eabde 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "gtest/gtest.h"
 
+#include "../task_model_info.hpp"
 #include "ImageHelper.h"
 #include "mv_face_detection.h"
 #include "mv_face_detection_internal.h"
@@ -36,14 +37,6 @@ using namespace std;
 
 using namespace MediaVision::Common;
 
-struct model_info {
-       string model_name;
-       string model_file;
-       string meta_file;
-       string label_file;
-       mv_source_h source;
-};
-
 void object_detection_callback(void *user_data)
 {
        mv_object_detection_h handle = static_cast<mv_object_detection_h>(user_data);
@@ -81,7 +74,7 @@ void object_detection_callback(void *user_data)
 TEST(ObjectDetectionAsyncTest, InferenceShouldBeOk)
 {
        mv_object_detection_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {} // If empty then default model will be used.
        };
 
@@ -89,8 +82,8 @@ TEST(ObjectDetectionAsyncTest, InferenceShouldBeOk)
                int ret = mv_object_detection_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_object_detection_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                       model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_object_detection_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                       model.label_file.c_str(), NULL);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_object_detection_set_engine(handle, "tflite", "cpu");
@@ -112,8 +105,6 @@ TEST(ObjectDetectionAsyncTest, InferenceShouldBeOk)
                        ret = ImageHelper::loadImageToSource(IMG_DOG, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-                       model.source = mv_source;
-
                        ret = mv_object_detection_inference_async(handle, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
@@ -134,7 +125,7 @@ TEST(ObjectDetectionAsyncTest, InferenceShouldBeOk)
 TEST(ObjectDetectionAsyncTest, InferenceShouldBeOkWithDestroyFirst)
 {
        mv_object_detection_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {} // If empty then default model will be used.
        };
 
@@ -142,8 +133,8 @@ TEST(ObjectDetectionAsyncTest, InferenceShouldBeOkWithDestroyFirst)
                int ret = mv_object_detection_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_object_detection_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                       model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_object_detection_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                       model.label_file.c_str(), NULL);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_object_detection_set_engine(handle, "tflite", "cpu");
@@ -165,8 +156,6 @@ TEST(ObjectDetectionAsyncTest, InferenceShouldBeOkWithDestroyFirst)
                        ret = ImageHelper::loadImageToSource(IMG_DOG, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-                       model.source = mv_source;
-
                        ret = mv_object_detection_inference_async(handle, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
@@ -221,7 +210,7 @@ void face_detection_callback(void *user_data)
 TEST(FaceDetectionAsyncTest, InferenceShouldBeOk)
 {
        mv_object_detection_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {} // If empty then default model will be used.
                // TODO.
        };
@@ -230,8 +219,8 @@ TEST(FaceDetectionAsyncTest, InferenceShouldBeOk)
                int ret = mv_face_detection_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_face_detection_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                 model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_face_detection_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                 model.label_file.c_str(), NULL);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_face_detection_set_engine(handle, "tflite", "cpu");
@@ -253,8 +242,6 @@ TEST(FaceDetectionAsyncTest, InferenceShouldBeOk)
                        ret = ImageHelper::loadImageToSource(IMG_FACE, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-                       model.source = mv_source;
-
                        ret = mv_face_detection_inference_async(handle, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
@@ -275,7 +262,7 @@ TEST(FaceDetectionAsyncTest, InferenceShouldBeOk)
 TEST(FaceDetectionAsyncTest, InferenceShouldBeOkWithDestroyFirst)
 {
        mv_object_detection_h handle;
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {} // If empty then default model will be used.
                // TODO.
        };
@@ -284,8 +271,8 @@ TEST(FaceDetectionAsyncTest, InferenceShouldBeOkWithDestroyFirst)
                int ret = mv_face_detection_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_face_detection_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                 model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_face_detection_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                 model.label_file.c_str(), NULL);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_face_detection_set_engine(handle, "tflite", "cpu");
@@ -307,8 +294,6 @@ TEST(FaceDetectionAsyncTest, InferenceShouldBeOkWithDestroyFirst)
                        ret = ImageHelper::loadImageToSource(IMG_FACE, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-                       model.source = mv_source;
-
                        ret = mv_face_detection_inference_async(handle, mv_source);
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
index cd32735c09266d7e098f54e51ab08fac6a3f2415..62732c33d1604e8d1d9c245db0a87597349ad802 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "gtest/gtest.h"
 
+#include "../task_model_info.hpp"
 #include "ImageHelper.h"
 #include "mv_object_detection_3d_internal.h"
 
@@ -30,13 +31,6 @@ using namespace std;
 
 using namespace MediaVision::Common;
 
-struct model_info {
-       string model_name;
-       string model_file;
-       string meta_file;
-       string label_file;
-};
-
 TEST(ObjectDetection3dTest, GettingAvailableInferenceEnginesInfoShouldBeOk)
 {
        mv_object_detection_3d_h handle;
@@ -85,7 +79,7 @@ TEST(ObjectDetection3dTest, GettingAvailableInferenceEnginesInfoShouldBeOk)
 
 TEST(ObjectDetection3dTest, InferenceShouldBeOk)
 {
-       vector<model_info> test_models {
+       vector<test_model_input> test_models {
                {}, // If empty then default model will be used.
                { "objectron", "object_detection_3d_cup.tflite", "object_detection_3d_cup.json", "" }
                // TODO.
@@ -108,8 +102,8 @@ TEST(ObjectDetection3dTest, InferenceShouldBeOk)
                ret = mv_object_detection_3d_create(&handle);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
-               ret = mv_object_detection_3d_set_model(handle, model.model_name.c_str(), model.model_file.c_str(),
-                                                                                          model.meta_file.c_str(), model.label_file.c_str());
+               ret = mv_object_detection_3d_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+                                                                                          model.label_file.c_str(), NULL);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_object_detection_3d_set_engine(handle, "tflite", "cpu");
diff --git a/test/testsuites/machine_learning/task_model_info.hpp b/test/testsuites/machine_learning/task_model_info.hpp
new file mode 100644 (file)
index 0000000..913662f
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __TASK_MODEL_INFO_HPP__
+#define __TASK_MODEL_INFO_HPP__
+
+#include <mv_common.h>
+#include <string>
+
+struct test_model_input {
+       std::string model_file;
+       std::string meta_file;
+       std::string label_file;
+       std::string model_name;
+};
+
+#endif // __TASK_MODEL_INFO_HPP__