From 1c966d632a612276d74896423961a9874e7ca994 Mon Sep 17 00:00:00 2001 From: Parichay Kapoor Date: Wed, 30 Dec 2020 22:02:53 +0900 Subject: [PATCH] [transfer learning] Enable test on ubuntu Enable testing of the trained model on ubuntu Added check to ensure that nnstreamer is enabled Signed-off-by: Parichay Kapoor --- .../TransferLearning/Draw_Classification/jni/main.cpp | 10 +++++----- .../TransferLearning/Draw_Classification/jni/meson.build | 13 ++++++------- meson.build | 4 ++++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Applications/TransferLearning/Draw_Classification/jni/main.cpp b/Applications/TransferLearning/Draw_Classification/jni/main.cpp index a87a48e..ae68537 100644 --- a/Applications/TransferLearning/Draw_Classification/jni/main.cpp +++ b/Applications/TransferLearning/Draw_Classification/jni/main.cpp @@ -25,7 +25,7 @@ * */ -#if defined(__TIZEN__) && defined(ENABLE_TEST) +#if defined(NNSTREAMER_AVAILABLE) && defined(ENABLE_TEST) #define APP_VALIDATE #endif @@ -34,7 +34,7 @@ #include #include -#if defined(__TIZEN__) +#if defined(NNSTREAMER_AVAILABLE) #include #endif #include @@ -218,7 +218,7 @@ int trainModel(const char *config) { return status; } -#if defined(__TIZEN__) +#if defined(NNSTREAMER_AVAILABLE) void sink_cb(const ml_tensors_data_h data, const ml_tensors_info_h info, void *user_data) { static int test_file_idx = 1; @@ -275,7 +275,7 @@ int getInputFeature_c(const std::string filename, float *feature_input) { * @param[in] config Model config file path */ int testModel(const char *data_path, const char *model) { -#if defined(__TIZEN__) +#if defined(NNSTREAMER_AVAILABLE) int status = ML_ERROR_NONE; ml_pipeline_h pipe; ml_pipeline_src_h src; @@ -378,7 +378,7 @@ fail_pipe_destroy: fail_exit: return status; #else - std::cout << "Testing of model only with TIZEN." << std::endl; + std::cout << "Testing of model is supported without NNStreamer." << std::endl; return ML_ERROR_NONE; #endif } diff --git a/Applications/TransferLearning/Draw_Classification/jni/meson.build b/Applications/TransferLearning/Draw_Classification/jni/meson.build index 4fd1a09..27f0436 100644 --- a/Applications/TransferLearning/Draw_Classification/jni/meson.build +++ b/Applications/TransferLearning/Draw_Classification/jni/meson.build @@ -4,13 +4,12 @@ res_path = meson.current_source_dir() / '..' / 'res' gst_api_version = '1.0' glib_dep = dependency('glib-2.0') gst_dep = dependency('gstreamer-'+gst_api_version) -if build_platform == 'tizen' - if not nnstreamer_capi_dep.found() - error('nnstreamer capi dependency not found for tizen') - endif - if not gtest_dep.found() - error('Gtest dependency not found for tizen') - endif + +if not nnstreamer_capi_dep.found() + error('nnstreamer capi dependency not found for tizen') +endif +if not gtest_dep.found() + error('Gtest dependency not found for tizen') endif training_sources = [ diff --git a/meson.build b/meson.build index 57419fb..866f65a 100644 --- a/meson.build +++ b/meson.build @@ -131,6 +131,10 @@ if not iniparser_dep.found() endif nnstreamer_capi_dep = dependency('capi-nnstreamer', required:false) +if nnstreamer_capi_dep.found() + add_project_arguments('-DNNSTREAMER_AVAILABLE=1', language:['c','cpp']) +endif + if get_option('enable-nnstreamer-backbone') add_project_arguments('-DENABLE_NNSTREAMER_BACKBONE=1', language:['c','cpp']) endif -- 2.7.4