mv_machine_learning: initialize backend type correctly
authorInki Dae <inki.dae@samsung.com>
Wed, 28 Feb 2024 00:56:02 +0000 (09:56 +0900)
committerKwanghoon Son <k.son@samsung.com>
Wed, 6 Mar 2024 02:20:30 +0000 (11:20 +0900)
[Issue type] : bug fix

Initialize _backendType member variable correctly with
MV_INFERENCE_BACKEND_NONE.

This patch fixes a issue that loading default backend type from meta config
file is skipped if user doesn't call mv_task_name_set_engine().

See below parseConfigFile function code in MvMlConfig.cpp,
if (_backendType == MV_INFERENCE_BACKEND_NONE) {
ret = config->getIntegerAttribute(MV_BACKEND_TYPE, &_backendType);
if (ret != MEDIA_VISION_ERROR_NONE)
throw InvalidOperation("Fail to get backend engine type.");
}

Change-Id: I1ae23b9893893e63bea36b40f6d9c75e940cc497
Signed-off-by: Inki Dae <inki.dae@samsung.com>
mv_machine_learning/common/include/MvMlConfig.h

index c8e038a9f8345526f3b7b475c0435547a4974a0f..6778a7e1f317ded0740e4ab88e2cdd91cc2b51f7 100644 (file)
@@ -38,8 +38,8 @@ private:
        std::string _modelLabelFilePath;
        std::string _pluginFileName;
        bool _usePlugin {};
-       int _backendType {};
-       int _targetDeviceType {};
+       int _backendType { MV_INFERENCE_BACKEND_NONE };
+       int _targetDeviceType { MV_INFERENCE_TARGET_DEVICE_NONE };
        double _confidence_threshold {};
 
 public: