mv_inference: Load mlapi specific ini file correctly
authorInki Dae <inki.dae@samsung.com>
Tue, 10 Nov 2020 02:54:02 +0000 (11:54 +0900)
committerInki Dae <inki.dae@samsung.com>
Tue, 10 Nov 2020 06:57:00 +0000 (15:57 +0900)
inference_engine_mlapi_backend.ini file is specific to MLAPI backend.
So load this file only in case that a given backend type is MLAPI.

Change-Id: I385d73d8571b506f8ffa6937985436fe8e18f96a
Signed-off-by: Inki Dae <inki.dae@samsung.com>
mv_inference/inference/src/Inference.cpp

index 5018c47ef30aa2ad4f8ff2a2bece1c8bf5d0e0f5..bde82648703e767d2158027256c64f9f5e500b07 100755 (executable)
@@ -1279,10 +1279,14 @@ namespace inference
                        return MEDIA_VISION_ERROR_OUT_OF_MEMORY;
                }
 
-               // Load configuration file.
-               int ret = mBackend->LoadConfigFile();
-               if (ret != INFERENCE_ENGINE_ERROR_NONE) {
-                       return MEDIA_VISION_ERROR_INVALID_OPERATION;
+               int ret = MEDIA_VISION_ERROR_NONE;
+
+               // Load configuration file if a given backend type is mlapi.
+               if (config.backend_type == MV_INFERENCE_BACKEND_MLAPI) {
+                       ret = mBackend->LoadConfigFile();
+                       if (ret != INFERENCE_ENGINE_ERROR_NONE) {
+                               return MEDIA_VISION_ERROR_INVALID_OPERATION;
+                       }
                }
 
                // Bind a backend library.