Add ARMNN and TFLITE backend support
[platform/core/multimedia/inference-engine-mlapi.git] / src / inference_engine_mlapi.cpp
index 29913e5..1a191b8 100644 (file)
@@ -63,7 +63,7 @@ namespace MLAPIImpl
                inference_backend_type_e type =
                                *(static_cast<inference_backend_type_e *>(data));
 
-               if (INFERENCE_BACKEND_ONE != type && INFERENCE_BACKEND_MLAPI != type) {
+               if (INFERENCE_BACKEND_NONE >= type || INFERENCE_BACKEND_MAX <= type) {
                        LOGE("Invalid backend type.");
                        return INFERENCE_ENGINE_ERROR_NOT_SUPPORTED;
                }
@@ -139,7 +139,14 @@ namespace MLAPIImpl
                        model_str += "," + model_paths[1];
                        break;
                case INFERENCE_BACKEND_ONE:
-                       nnfw_type = ML_NNFW_TYPE_NNFW;
+               case INFERENCE_BACKEND_ARMNN:
+               case INFERENCE_BACKEND_TFLITE:
+                       if (mPluginType == INFERENCE_BACKEND_ONE)
+                               nnfw_type = ML_NNFW_TYPE_NNFW;
+                       if (mPluginType == INFERENCE_BACKEND_ARMNN)
+                               nnfw_type = ML_NNFW_TYPE_ARMNN;
+                       if (mPluginType == INFERENCE_BACKEND_TFLITE)
+                               nnfw_type = ML_NNFW_TYPE_TENSORFLOW_LITE;
 
                        if (access(model_str.c_str(), R_OK)) {
                                LOGE("model file path in [%s]", model_str.c_str());