mv_machine_learning: add SNPE inference engine support 32/267032/2
authorInki Dae <inki.dae@samsung.com>
Wed, 24 Nov 2021 08:39:23 +0000 (17:39 +0900)
committerInki Dae <inki.dae@samsung.com>
Thu, 25 Nov 2021 05:26:33 +0000 (14:26 +0900)
[Version] : 0.9.0-0
[Issue type] : new feature

Change-Id: Iabfc4932d808296c8941bc8bbacf88b9fbe09616
Signed-off-by: Inki Dae <inki.dae@samsung.com>
include/mv_inference_type.h
mv_machine_learning/mv_inference/inference/src/Inference.cpp
packaging/capi-media-vision.spec

index a259b77..5a6572d 100644 (file)
@@ -65,6 +65,8 @@ typedef enum {
     MV_INFERENCE_BACKEND_ARMNN,     /**< ARMNN (Since 6.0) */
     MV_INFERENCE_BACKEND_MLAPI,     /**< ML Single API of NNStreamer (Since 6.0) */
     MV_INFERENCE_BACKEND_ONE,       /**< On-device Neural Engine (Since 6.0) */
+    MV_INFERENCE_BACKEND_NNTRAINER, /**< NNTrainer (Since 7.0) */
+    MV_INFERENCE_BACKEND_SNPE,      /**< SNPE Engine (Since 7.0) */
     MV_INFERENCE_BACKEND_MAX        /**< Backend MAX */
 } mv_inference_backend_type_e;
 
index 0308e49..fdd0560 100755 (executable)
@@ -81,6 +81,8 @@ namespace inference
        {
                LOGI("ENTER");
 
+               // Mediavision can support several inference engines via ML Single API
+               // "mlapi" means that the inference backend is used via ML Single API.
                mSupportedInferenceBackend.insert(std::make_pair(
                                MV_INFERENCE_BACKEND_OPENCV, std::make_pair("opencv", false)));
                mSupportedInferenceBackend.insert(std::make_pair(
@@ -91,6 +93,8 @@ namespace inference
                                MV_INFERENCE_BACKEND_MLAPI, std::make_pair("mlapi", false)));
                mSupportedInferenceBackend.insert(std::make_pair(
                                MV_INFERENCE_BACKEND_ONE, std::make_pair("mlapi", false)));
+               mSupportedInferenceBackend.insert(std::make_pair(
+                               MV_INFERENCE_BACKEND_SNPE, std::make_pair("mlapi", false)));
 
                CheckSupportedInferenceBackend();
 
@@ -115,6 +119,8 @@ namespace inference
                                std::make_pair<std::string, int>("onnx", INFERENCE_MODEL_ONNX));
                mModelFormats.insert(std::make_pair<std::string, int>(
                                "nb", INFERENCE_MODEL_VIVANTE));
+               mModelFormats.insert(std::make_pair<std::string, int>(
+                               "dlc", INFERENCE_MODEL_SNPE));
 
                LOGI("LEAVE");
        }
@@ -938,6 +944,7 @@ namespace inference
                        break;
                case INFERENCE_MODEL_TFLITE:
                case INFERENCE_MODEL_TORCH:
+               case INFERENCE_MODEL_SNPE:
                        models.push_back(mConfig.mWeightFilePath);
                        break;
                default:
index 789842c..1af9b65 100644 (file)
@@ -1,7 +1,7 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.8.19
-Release:     1
+Version:     0.9.0
+Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-3-Clause
 Source0:     %{name}-%{version}.tar.gz