Skip ParseMetadata() if a metadata json file doesn't exist 67/263667/1
authorTae-Young Chung <ty83.chung@samsung.com>
Wed, 8 Sep 2021 01:14:23 +0000 (10:14 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Wed, 8 Sep 2021 01:15:06 +0000 (10:15 +0900)
Change-Id: Ibfc01bd79fe300447034f7504c4573abec47223a
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
mv_machine_learning/mv_inference/inference/src/mv_inference_open.cpp
packaging/capi-media-vision.spec

index d41b471..da295ab 100644 (file)
@@ -168,12 +168,6 @@ int mv_inference_configure_model_open(mv_inference_h infer,
                goto _ERROR_;
        }
 
-       if (!IsJsonFile(std::string(modelMetaFilePath))) {
-               ret = MEDIA_VISION_ERROR_INVALID_PATH;
-               LOGE("Model meta file should be json");
-               goto _ERROR_;
-       }
-
        ret = mv_engine_config_get_double_attribute(
                        engine_config, MV_INFERENCE_MODEL_MEAN_VALUE, &modelMeanValue);
        if (ret != MEDIA_VISION_ERROR_NONE) {
@@ -219,6 +213,17 @@ int mv_inference_configure_model_open(mv_inference_h infer,
                                                                std::string(modelWeightFilePath),
                                                                std::string(modelUserFilePath));
 
+       if (std::string(modelMetaFilePath).empty()) {
+               LOGW("Skip ParseMetadata and run without Metadata");
+               goto _ERROR_;
+       }
+
+       if (!IsJsonFile(std::string(modelMetaFilePath))) {
+               ret = MEDIA_VISION_ERROR_INVALID_PATH;
+               LOGE("Model meta file should be json");
+               goto _ERROR_;
+       }
+
        ret = pInfer->ParseMetadata(std::string(modelMetaFilePath));
        if (ret != MEDIA_VISION_ERROR_NONE) {
                LOGE("Fail to ParseMetadata");
index a6a9574..456297f 100644 (file)
@@ -1,6 +1,6 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.8.15
+Version:     0.8.16
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-3-Clause