mv_machine_learning: do not check model info
authorInki Dae <inki.dae@samsung.com>
Mon, 7 Aug 2023 23:45:12 +0000 (08:45 +0900)
committerKwanghoon Son <k.son@samsung.com>
Mon, 4 Sep 2023 04:57:02 +0000 (13:57 +0900)
[Issue type] : bug fix

Do not check model info given by user because the user-given model info
is optional but not mandatory. If the model info isn't set then default
one will be used instead.

Change-Id: I4b7dea2e2e3c53a6e418e5ac7f7cc22c328cdbd6
Signed-off-by: Inki Dae <inki.dae@samsung.com>
mv_machine_learning/object_detection/src/mv_object_detection.cpp
mv_machine_learning/object_detection/src/object_detection_adapter.cpp

index a941594..a22245d 100644 (file)
@@ -99,10 +99,6 @@ int mv_object_detection_set_model(mv_object_detection_h handle, const char *mode
        MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
 
        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);
 
        MEDIA_VISION_FUNCTION_ENTER();
 
index c6bb566..de9ccbd 100644 (file)
@@ -90,9 +90,12 @@ void ObjectDetectionAdapter<T, V>::setModelInfo(const char *model_file, const ch
                LOGW("A given model name is invalid so default task type will be used.");
        }
 
-       _model_file = string(model_file);
-       _meta_file = string(meta_file);
-       _label_file = string(label_file);
+       if (model_file)
+               _model_file = model_file;
+       if (meta_file)
+               _meta_file = meta_file;
+       if (label_file)
+               _label_file = label_file;
 
        if (_model_file.empty() && _meta_file.empty() && _label_file.empty()) {
                LOGW("Given model info is invalid so default model info will be used instead.");