From de715e96053412ad5171697954cd94cc8382ec3e Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Tue, 12 Nov 2019 11:05:16 +0900 Subject: [PATCH] [C-API] Support MVNC with Single API Let C-API users use Intel NCS. CC: Wook Song Signed-off-by: MyungJoo Ham --- api/capi/include/nnstreamer.h | 2 ++ api/capi/src/nnstreamer-capi-single.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/api/capi/include/nnstreamer.h b/api/capi/include/nnstreamer.h index 3aa0720..0ae691c 100644 --- a/api/capi/include/nnstreamer.h +++ b/api/capi/include/nnstreamer.h @@ -116,6 +116,7 @@ typedef void *ml_pipeline_valve_h; /** * @brief Types of NNFWs. * @since_tizen 5.5 + * @details To check if a nnfw-type is supported in a system, an application may call the API, ml_check_nnfw_availability() */ typedef enum { ML_NNFW_TYPE_ANY = 0, /**< NNHW is not specified (Try to determine the NNFW with file extension). */ @@ -123,6 +124,7 @@ typedef enum { ML_NNFW_TYPE_TENSORFLOW_LITE, /**< Tensorflow-lite (.tflite). */ ML_NNFW_TYPE_TENSORFLOW, /**< Tensorflow (.pb). */ ML_NNFW_TYPE_NNFW, /**< Neural Network Inference framework, which is developed by SR */ + ML_NNFW_TYPE_MVNC, /**< Intel NCSDK (libmvnc). */ } ml_nnfw_type_e; /** diff --git a/api/capi/src/nnstreamer-capi-single.c b/api/capi/src/nnstreamer-capi-single.c index 359b30b..32954aa 100644 --- a/api/capi/src/nnstreamer-capi-single.c +++ b/api/capi/src/nnstreamer-capi-single.c @@ -478,6 +478,10 @@ ml_single_open (ml_single_h * single, const char *model, goto error; } break; + case ML_NNFW_TYPE_MVNC: + g_object_set (filter_obj, "framework", "movidius-ncsdk2", "model", model, NULL); + /** @todo Verify this! (this code is not tested) */ + break; default: /** @todo Add other fw later. */ ml_loge ("The given nnfw is not supported."); -- 2.7.4