From 213a543dd0d07b2f8d51a9c7e2055fd99291c960 Mon Sep 17 00:00:00 2001 From: Liam Barry Date: Mon, 9 May 2022 17:06:19 +0100 Subject: MLECO-3186: Each use case should same namespace convention as KWS and ASR Certain UCs required additional work due to case context variables which also became part of a namespace in generated files. Solution was to declare these extra variables as part of the UC namespace in the respective model.hpp files. Additional changes to standardise use of namespaces may be required - proposing new task. Minor typo and rewording of customizing.md in relevant sections included. Signed-off-by: Liam Barry Change-Id: Ie78f82a30be252cb841136ea5115f21fc8d762cb --- tests/use_case/ad/InferenceTestAD.cc | 25 +++++----- .../use_case/img_class/ImgClassificationUCTest.cc | 37 +++++++-------- .../use_case/img_class/InferenceTestMobilenetV2.cc | 19 ++++---- tests/use_case/kws/InferenceTestMicroNetKws.cc | 3 +- tests/use_case/kws/KWSHandlerTest.cc | 2 +- tests/use_case/kws_asr/InferenceTestMicroNetKws.cc | 14 +++--- tests/use_case/kws_asr/InferenceTestWav2Letter.cc | 15 +++--- .../noise_reduction/InferenceTestRNNoise.cc | 29 ++++++------ tests/use_case/noise_reduction/RNNNoiseUCTests.cc | 54 +++++++++++----------- .../use_case/noise_reduction/RNNoiseModelTests.cc | 29 ++++++------ .../object_detection/InferenceTestYoloFastest.cc | 19 ++++---- .../object_detection/ObjectDetectionUCTest.cc | 31 +++++++------ tests/use_case/vww/VisualWakeWordUCTests.cc | 37 +++++++-------- 13 files changed, 161 insertions(+), 153 deletions(-) (limited to 'tests') diff --git a/tests/use_case/ad/InferenceTestAD.cc b/tests/use_case/ad/InferenceTestAD.cc index d837617..d033407 100644 --- a/tests/use_case/ad/InferenceTestAD.cc +++ b/tests/use_case/ad/InferenceTestAD.cc @@ -29,14 +29,15 @@ #endif /* AD_FEATURE_VEC_DATA_SIZE */ namespace arm { - namespace app { - static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; - } /* namespace app */ +namespace app { + static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + namespace ad { + extern uint8_t* GetModelPointer(); + extern size_t GetModelLen(); + } /* namespace ad */ +} /* namespace app */ } /* namespace arm */ -extern uint8_t* GetModelPointer(); -extern size_t GetModelLen(); - using namespace test; bool RunInference(arm::app::Model& model, const int8_t vec[]) @@ -95,9 +96,9 @@ TEST_CASE("Running random inference with TensorFlow Lite Micro and AdModel Int8" REQUIRE_FALSE(model.IsInited()); REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::ad::GetModelPointer(), + arm::app::ad::GetModelLen())); REQUIRE(model.IsInited()); REQUIRE(RunInferenceRandom(model)); @@ -116,9 +117,9 @@ TEST_CASE("Running golden vector inference with TensorFlow Lite Micro and AdMode REQUIRE_FALSE(model.IsInited()); REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::ad::GetModelPointer(), + arm::app::ad::GetModelLen())); REQUIRE(model.IsInited()); TestInference(input_goldenFV, output_goldenFV, model); diff --git a/tests/use_case/img_class/ImgClassificationUCTest.cc b/tests/use_case/img_class/ImgClassificationUCTest.cc index d8339b6..1685e5f 100644 --- a/tests/use_case/img_class/ImgClassificationUCTest.cc +++ b/tests/use_case/img_class/ImgClassificationUCTest.cc @@ -25,14 +25,15 @@ #include namespace arm { - namespace app { - static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; - } /* namespace app */ +namespace app { + static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + namespace img_class { + extern uint8_t* GetModelPointer(); + extern size_t GetModelLen(); + } /* namespace img_class */ +} /* namespace app */ } /* namespace arm */ -extern uint8_t* GetModelPointer(); -extern size_t GetModelLen(); - TEST_CASE("Model info") { /* Model wrapper object. */ @@ -40,9 +41,9 @@ TEST_CASE("Model info") /* Load the model. */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::img_class::GetModelPointer(), + arm::app::img_class::GetModelLen())); /* Instantiate application context. */ arm::app::ApplicationContext caseContext; @@ -63,9 +64,9 @@ TEST_CASE("Inference by index", "[.]") /* Load the model. */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::img_class::GetModelPointer(), + arm::app::img_class::GetModelLen())); /* Instantiate application context. */ arm::app::ApplicationContext caseContext; @@ -99,9 +100,9 @@ TEST_CASE("Inference run all images", "[.]") /* Load the model. */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::img_class::GetModelPointer(), + arm::app::img_class::GetModelLen())); /* Instantiate application context. */ arm::app::ApplicationContext caseContext; @@ -131,9 +132,9 @@ TEST_CASE("List all images") /* Load the model. */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::img_class::GetModelPointer(), + arm::app::img_class::GetModelLen())); /* Instantiate application context. */ arm::app::ApplicationContext caseContext; diff --git a/tests/use_case/img_class/InferenceTestMobilenetV2.cc b/tests/use_case/img_class/InferenceTestMobilenetV2.cc index 30ce19f..6cc1190 100644 --- a/tests/use_case/img_class/InferenceTestMobilenetV2.cc +++ b/tests/use_case/img_class/InferenceTestMobilenetV2.cc @@ -25,12 +25,13 @@ namespace arm { namespace app { static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + namespace img_class { + extern uint8_t* GetModelPointer(); + extern size_t GetModelLen(); + } /* namespace img_class */ } /* namespace app */ } /* namespace arm */ -extern uint8_t* GetModelPointer(); -extern size_t GetModelLen(); - using namespace test; bool RunInference(arm::app::Model& model, const int8_t imageData[]) @@ -78,9 +79,9 @@ TEST_CASE("Running inference with TensorFlow Lite Micro and MobileNeV2 Uint8", " REQUIRE_FALSE(model.IsInited()); REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::img_class::GetModelPointer(), + arm::app::img_class::GetModelLen())); REQUIRE(model.IsInited()); for (uint32_t i = 0 ; i < NUMBER_OF_IFM_FILES; ++i) { @@ -95,9 +96,9 @@ TEST_CASE("Running inference with TensorFlow Lite Micro and MobileNeV2 Uint8", " REQUIRE_FALSE(model.IsInited()); REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::img_class::GetModelPointer(), + arm::app::img_class::GetModelLen())); REQUIRE(model.IsInited()); TestInference(i, model, 1); diff --git a/tests/use_case/kws/InferenceTestMicroNetKws.cc b/tests/use_case/kws/InferenceTestMicroNetKws.cc index a6f7a03..3dc75e3 100644 --- a/tests/use_case/kws/InferenceTestMicroNetKws.cc +++ b/tests/use_case/kws/InferenceTestMicroNetKws.cc @@ -25,9 +25,8 @@ namespace arm { namespace app { static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; - namespace kws { - extern uint8_t *GetModelPointer(); + extern uint8_t* GetModelPointer(); extern size_t GetModelLen(); } /* namespace kws */ } /* namespace app */ diff --git a/tests/use_case/kws/KWSHandlerTest.cc b/tests/use_case/kws/KWSHandlerTest.cc index d9d00a8..db67e54 100644 --- a/tests/use_case/kws/KWSHandlerTest.cc +++ b/tests/use_case/kws/KWSHandlerTest.cc @@ -30,7 +30,7 @@ namespace arm { namespace kws { extern uint8_t* GetModelPointer(); extern size_t GetModelLen(); - } + } /* namespace kws */ } /* namespace app */ } /* namespace arm */ diff --git a/tests/use_case/kws_asr/InferenceTestMicroNetKws.cc b/tests/use_case/kws_asr/InferenceTestMicroNetKws.cc index 4ba4693..76c7e90 100644 --- a/tests/use_case/kws_asr/InferenceTestMicroNetKws.cc +++ b/tests/use_case/kws_asr/InferenceTestMicroNetKws.cc @@ -23,13 +23,13 @@ #include namespace arm { - namespace app { - static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; - namespace kws { - extern uint8_t* GetModelPointer(); - extern size_t GetModelLen(); - } - } /* namespace app */ +namespace app { + static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + namespace kws { + extern uint8_t* GetModelPointer(); + extern size_t GetModelLen(); + } /* namespace kws */ +} /* namespace app */ } /* namespace arm */ namespace test { diff --git a/tests/use_case/kws_asr/InferenceTestWav2Letter.cc b/tests/use_case/kws_asr/InferenceTestWav2Letter.cc index 5d30211..6089e91 100644 --- a/tests/use_case/kws_asr/InferenceTestWav2Letter.cc +++ b/tests/use_case/kws_asr/InferenceTestWav2Letter.cc @@ -23,14 +23,13 @@ #include namespace arm { - namespace app { - static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; - - namespace asr { - extern uint8_t* GetModelPointer(); - extern size_t GetModelLen(); - } - } /* namespace app */ +namespace app { + static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + namespace asr { + extern uint8_t* GetModelPointer(); + extern size_t GetModelLen(); + } /* namespace asr */ +} /* namespace app */ } /* namespace arm */ namespace test { diff --git a/tests/use_case/noise_reduction/InferenceTestRNNoise.cc b/tests/use_case/noise_reduction/InferenceTestRNNoise.cc index 9dc640b..fdc59c1 100644 --- a/tests/use_case/noise_reduction/InferenceTestRNNoise.cc +++ b/tests/use_case/noise_reduction/InferenceTestRNNoise.cc @@ -23,16 +23,17 @@ #include namespace arm { - namespace app { - static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; - } /* namespace app */ +namespace app { + static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + namespace rnn { + extern uint8_t* GetModelPointer(); + extern size_t GetModelLen(); + } /* namespace rnn */ +} /* namespace app */ } /* namespace arm */ -extern uint8_t* GetModelPointer(); -extern size_t GetModelLen(); - namespace test { -namespace rnnoise { +namespace noise_reduction { bool RunInference(arm::app::Model& model, const std::vector> inData) { @@ -73,9 +74,9 @@ namespace rnnoise { REQUIRE_FALSE(model.IsInited()); REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::rnn::GetModelPointer(), + arm::app::rnn::GetModelLen())); REQUIRE(model.IsInited()); REQUIRE(RunInferenceRandom(model)); @@ -135,14 +136,14 @@ namespace rnnoise { REQUIRE_FALSE(model.IsInited()); REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::rnn::GetModelPointer(), + arm::app::rnn::GetModelLen())); REQUIRE(model.IsInited()); TestInference(goldenInputFV, goldenOutputFV, model); } } -} /* namespace rnnoise */ +} /* namespace noise_reduction */ } /* namespace test */ diff --git a/tests/use_case/noise_reduction/RNNNoiseUCTests.cc b/tests/use_case/noise_reduction/RNNNoiseUCTests.cc index bebfdfd..310814f 100644 --- a/tests/use_case/noise_reduction/RNNNoiseUCTests.cc +++ b/tests/use_case/noise_reduction/RNNNoiseUCTests.cc @@ -25,14 +25,15 @@ #include namespace arm { - namespace app { - static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; - } /* namespace app */ +namespace app { + static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + namespace rnn { + extern uint8_t* GetModelPointer(); + extern size_t GetModelLen(); + } /* namespace rnn */ +} /* namespace app */ } /* namespace arm */ -extern uint8_t* GetModelPointer(); -extern size_t GetModelLen(); - #define PLATFORM hal_platform_init(); #define CONTEXT \ @@ -48,9 +49,9 @@ TEST_CASE("Verify output tensor memory dump") arm::app::RNNoiseModel model{}; REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::rnn::GetModelPointer(), + arm::app::rnn::GetModelLen())); REQUIRE(model.IsInited()); /* Populate the output tensors */ @@ -112,15 +113,15 @@ TEST_CASE("Inference run all clips", "[RNNoise]") CONTEXT caseContext.Set("clipIndex", 0); - caseContext.Set("numInputFeatures", g_NumInputFeatures); - caseContext.Set("frameLength", g_FrameLength); - caseContext.Set("frameStride", g_FrameStride); + caseContext.Set("numInputFeatures", arm::app::rnn::g_NumInputFeatures); + caseContext.Set("frameLength", arm::app::rnn::g_FrameLength); + caseContext.Set("frameStride", arm::app::rnn::g_FrameStride); /* Load the model. */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::rnn::GetModelPointer(), + arm::app::rnn::GetModelLen())); REQUIRE(arm::app::NoiseReductionHandler(caseContext, true)); } @@ -147,22 +148,22 @@ void testInfByIndex(std::vector& numberOfInferences) { caseContext.Set>("features", get_audio_array); caseContext.Set>("featureFileNames", get_test_filename); - caseContext.Set("frameLength", g_FrameLength); - caseContext.Set("frameStride", g_FrameStride); - caseContext.Set("numInputFeatures", g_NumInputFeatures); + caseContext.Set("frameLength", arm::app::rnn::g_FrameLength); + caseContext.Set("frameStride", arm::app::rnn::g_FrameStride); + caseContext.Set("numInputFeatures", arm::app::rnn::g_NumInputFeatures); /* Load the model. */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::rnn::GetModelPointer(), + arm::app::rnn::GetModelLen())); - size_t oneInferenceOutSizeBytes = g_FrameLength * sizeof(int16_t); + size_t oneInferenceOutSizeBytes = arm::app::rnn::g_FrameLength * sizeof(int16_t); auto infIndex = 0; for (auto numInf: numberOfInferences) { DYNAMIC_SECTION("Number of features: "<< numInf) { caseContext.Set("clipIndex", 1); /* Only getting p232_208.wav for tests. */ - uint32_t audioSizeInput = numInf*g_FrameLength; + uint32_t audioSizeInput = numInf * arm::app::rnn::g_FrameLength; caseContext.Set>("featureSizes", get_golden_input_p232_208_array_size(audioSizeInput)); @@ -180,12 +181,13 @@ void testInfByIndex(std::vector& numberOfInferences) { REQUIRE(arm::app::NoiseReductionHandler(caseContext, false)); /* The expected output after post-processing. */ - std::vector golden(&ofms[infIndex][0], &ofms[infIndex][0] + g_FrameLength); + std::vector golden(&ofms[infIndex][0], + &ofms[infIndex][0] + arm::app::rnn::g_FrameLength); size_t startOfLastInfOut = undefMemDumpBytesWritten - oneInferenceOutSizeBytes; /* The actual result from the usecase handler. */ - std::vector runtime(g_FrameLength); + std::vector runtime(arm::app::rnn::g_FrameLength); std::memcpy(runtime.data(), &memDump[startOfLastInfOut], oneInferenceOutSizeBytes); /* Margin of 43 is 0.07% error. */ @@ -211,7 +213,7 @@ TEST_CASE("Inference by index - several inferences", "[RNNoise]") REQUIRE(64757 == totalAudioSize); /* Checking that the input file is as expected and has not changed. */ /* 3 different inference amounts: 1, 2 and all inferences required to cover total feature set */ - uint32_t totalInferences = totalAudioSize / g_FrameLength; + uint32_t totalInferences = totalAudioSize / arm::app::rnn::g_FrameLength; std::vector numberOfInferences = {1, 2, totalInferences}; testInfByIndex(numberOfInferences); } diff --git a/tests/use_case/noise_reduction/RNNoiseModelTests.cc b/tests/use_case/noise_reduction/RNNoiseModelTests.cc index 9720ba5..7bd83b1 100644 --- a/tests/use_case/noise_reduction/RNNoiseModelTests.cc +++ b/tests/use_case/noise_reduction/RNNoiseModelTests.cc @@ -23,14 +23,15 @@ #include namespace arm { - namespace app { - static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; - } /* namespace app */ +namespace app { + static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + namespace rnn { + extern uint8_t* GetModelPointer(); + extern size_t GetModelLen(); + } /* namespace rnn */ +} /* namespace app */ } /* namespace arm */ -extern uint8_t* GetModelPointer(); -extern size_t GetModelLen(); - bool RunInference(arm::app::Model& model, std::vector vec, const size_t sizeRequired, const size_t dataInputIndex) { @@ -73,8 +74,8 @@ TEST_CASE("Running random inference with TensorFlow Lite Micro and RNNoiseModel REQUIRE_FALSE(model.IsInited()); REQUIRE(model.Init(arm::app::tensorArena, sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + arm::app::rnn::GetModelPointer(), + arm::app::rnn::GetModelLen())); REQUIRE(model.IsInited()); model.ResetGruState(); @@ -128,9 +129,9 @@ TEST_CASE("Test initial GRU out state is 0", "[RNNoise]") { TestRNNoiseModel model{}; model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen()); + sizeof(arm::app::tensorArena), + arm::app::rnn::GetModelPointer(), + arm::app::rnn::GetModelLen()); auto map = model.GetStateMap(); @@ -152,9 +153,9 @@ TEST_CASE("Test GRU state copy", "[RNNoise]") { TestRNNoiseModel model{}; model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen()); + sizeof(arm::app::tensorArena), + arm::app::rnn::GetModelPointer(), + arm::app::rnn::GetModelLen()); REQUIRE(RunInferenceRandom(model, 0)); auto map = model.GetStateMap(); diff --git a/tests/use_case/object_detection/InferenceTestYoloFastest.cc b/tests/use_case/object_detection/InferenceTestYoloFastest.cc index 1b4d1dd..eb92904 100644 --- a/tests/use_case/object_detection/InferenceTestYoloFastest.cc +++ b/tests/use_case/object_detection/InferenceTestYoloFastest.cc @@ -25,12 +25,13 @@ namespace arm { namespace app { static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + namespace object_detection { + extern uint8_t* GetModelPointer(); + extern size_t GetModelLen(); + } /* namespace object_detection */ } /* namespace app */ } /* namespace arm */ -extern uint8_t* GetModelPointer(); -extern size_t GetModelLen(); - #include void GetExpectedResults(std::vector> &expected_results) @@ -132,9 +133,9 @@ TEST_CASE("Running inference with TensorFlow Lite Micro and YoloFastest", "[Yolo REQUIRE_FALSE(model.IsInited()); REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::object_detection::GetModelPointer(), + arm::app::object_detection::GetModelLen())); REQUIRE(model.IsInited()); for (uint32_t i = 0 ; i < NUMBER_OF_FILES; ++i) { @@ -149,9 +150,9 @@ TEST_CASE("Running inference with TensorFlow Lite Micro and YoloFastest", "[Yolo REQUIRE_FALSE(model.IsInited()); REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::object_detection::GetModelPointer(), + arm::app::object_detection::GetModelLen())); REQUIRE(model.IsInited()); TestInferenceDetectionResults(i, model, 1); diff --git a/tests/use_case/object_detection/ObjectDetectionUCTest.cc b/tests/use_case/object_detection/ObjectDetectionUCTest.cc index ffb4976..c21a416 100644 --- a/tests/use_case/object_detection/ObjectDetectionUCTest.cc +++ b/tests/use_case/object_detection/ObjectDetectionUCTest.cc @@ -27,12 +27,13 @@ namespace arm { namespace app { static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + namespace object_detection { + extern uint8_t* GetModelPointer(); + extern size_t GetModelLen(); + } /* namespace object_detection */ } /* namespace app */ } /* namespace arm */ -extern uint8_t* GetModelPointer(); -extern size_t GetModelLen(); - TEST_CASE("Model info") { /* Model wrapper object. */ @@ -40,9 +41,9 @@ TEST_CASE("Model info") /* Load the model. */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::object_detection::GetModelPointer(), + arm::app::object_detection::GetModelLen())); /* Instantiate application context. */ arm::app::ApplicationContext caseContext; @@ -63,9 +64,9 @@ TEST_CASE("Inference by index") /* Load the model. */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::object_detection::GetModelPointer(), + arm::app::object_detection::GetModelLen())); /* Instantiate application context. */ arm::app::ApplicationContext caseContext; @@ -89,9 +90,9 @@ TEST_CASE("Inference run all images") /* Load the model. */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::object_detection::GetModelPointer(), + arm::app::object_detection::GetModelLen())); /* Instantiate application context. */ arm::app::ApplicationContext caseContext; @@ -115,9 +116,9 @@ TEST_CASE("List all images") /* Load the model. */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::object_detection::GetModelPointer(), + arm::app::object_detection::GetModelLen())); /* Instantiate application context. */ arm::app::ApplicationContext caseContext; diff --git a/tests/use_case/vww/VisualWakeWordUCTests.cc b/tests/use_case/vww/VisualWakeWordUCTests.cc index 05a31a4..fe3782b 100644 --- a/tests/use_case/vww/VisualWakeWordUCTests.cc +++ b/tests/use_case/vww/VisualWakeWordUCTests.cc @@ -25,23 +25,24 @@ #include "UseCaseCommonUtils.hpp" namespace arm { - namespace app { - static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; - } /* namespace app */ +namespace app { + static uint8_t tensorArena[ACTIVATION_BUF_SZ] ACTIVATION_BUF_ATTRIBUTE; + namespace vww { + extern uint8_t* GetModelPointer(); + extern size_t GetModelLen(); + } /* namespace vww */ +} /* namespace app */ } /* namespace arm */ -extern uint8_t* GetModelPointer(); -extern size_t GetModelLen(); - TEST_CASE("Model info") { arm::app::VisualWakeWordModel model; /* model wrapper object */ /* Load the model */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::vww::GetModelPointer(), + arm::app::vww::GetModelLen())); /* Instantiate application context */ arm::app::ApplicationContext caseContext; @@ -59,9 +60,9 @@ TEST_CASE("Inference by index") /* Load the model */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::vww::GetModelPointer(), + arm::app::vww::GetModelLen())); /* Instantiate application context */ arm::app::ApplicationContext caseContext; @@ -92,9 +93,9 @@ TEST_CASE("Inference run all images") /* Load the model */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::vww::GetModelPointer(), + arm::app::vww::GetModelLen())); /* Instantiate application context */ arm::app::ApplicationContext caseContext; @@ -121,9 +122,9 @@ TEST_CASE("List all images") /* Load the model */ REQUIRE(model.Init(arm::app::tensorArena, - sizeof(arm::app::tensorArena), - GetModelPointer(), - GetModelLen())); + sizeof(arm::app::tensorArena), + arm::app::vww::GetModelPointer(), + arm::app::vww::GetModelLen())); /* Instantiate application context */ arm::app::ApplicationContext caseContext; -- cgit v1.2.1