summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLiam Barry <liam.barry@arm.com>2022-05-09 17:06:19 +0100
committerKshitij Sisodia <kshitij.sisodia@arm.com>2022-05-12 16:10:06 +0000
commit213a543dd0d07b2f8d51a9c7e2055fd99291c960 (patch)
tree7357c9961f395131140f8937e732fee68963dc63 /tests
parentdd44d29775e53ad311e1997bb8a7670d0ee6383e (diff)
downloadml-embedded-evaluation-kit-213a543dd0d07b2f8d51a9c7e2055fd99291c960.tar.gz
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 <liam.barry@arm.com> Change-Id: Ie78f82a30be252cb841136ea5115f21fc8d762cb
Diffstat (limited to 'tests')
-rw-r--r--tests/use_case/ad/InferenceTestAD.cc25
-rw-r--r--tests/use_case/img_class/ImgClassificationUCTest.cc37
-rw-r--r--tests/use_case/img_class/InferenceTestMobilenetV2.cc19
-rw-r--r--tests/use_case/kws/InferenceTestMicroNetKws.cc3
-rw-r--r--tests/use_case/kws/KWSHandlerTest.cc2
-rw-r--r--tests/use_case/kws_asr/InferenceTestMicroNetKws.cc14
-rw-r--r--tests/use_case/kws_asr/InferenceTestWav2Letter.cc15
-rw-r--r--tests/use_case/noise_reduction/InferenceTestRNNoise.cc29
-rw-r--r--tests/use_case/noise_reduction/RNNNoiseUCTests.cc54
-rw-r--r--tests/use_case/noise_reduction/RNNoiseModelTests.cc29
-rw-r--r--tests/use_case/object_detection/InferenceTestYoloFastest.cc19
-rw-r--r--tests/use_case/object_detection/ObjectDetectionUCTest.cc31
-rw-r--r--tests/use_case/vww/VisualWakeWordUCTests.cc37
13 files changed, 161 insertions, 153 deletions
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<int8_t>(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 <catch.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 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<uint8_t>(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 <random>
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 <random>
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 <random>
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<std::vector<int8_t>> 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<int8_t>(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 <Profiler.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 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<uint32_t>("clipIndex", 0);
- caseContext.Set<uint32_t>("numInputFeatures", g_NumInputFeatures);
- caseContext.Set<uint32_t>("frameLength", g_FrameLength);
- caseContext.Set<uint32_t>("frameStride", g_FrameStride);
+ caseContext.Set<uint32_t>("numInputFeatures", arm::app::rnn::g_NumInputFeatures);
+ caseContext.Set<uint32_t>("frameLength", arm::app::rnn::g_FrameLength);
+ caseContext.Set<uint32_t>("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<uint32_t>& numberOfInferences) {
caseContext.Set<std::function<const int16_t*(const uint32_t)>>("features", get_audio_array);
caseContext.Set<std::function<const char* (const uint32_t)>>("featureFileNames", get_test_filename);
- caseContext.Set<uint32_t>("frameLength", g_FrameLength);
- caseContext.Set<uint32_t>("frameStride", g_FrameStride);
- caseContext.Set<uint32_t>("numInputFeatures", g_NumInputFeatures);
+ caseContext.Set<uint32_t>("frameLength", arm::app::rnn::g_FrameLength);
+ caseContext.Set<uint32_t>("frameStride", arm::app::rnn::g_FrameStride);
+ caseContext.Set<uint32_t>("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<uint32_t>("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<std::function<uint32_t(const uint32_t)>>("featureSizes",
get_golden_input_p232_208_array_size(audioSizeInput));
@@ -180,12 +181,13 @@ void testInfByIndex(std::vector<uint32_t>& numberOfInferences) {
REQUIRE(arm::app::NoiseReductionHandler(caseContext, false));
/* The expected output after post-processing. */
- std::vector<int16_t> golden(&ofms[infIndex][0], &ofms[infIndex][0] + g_FrameLength);
+ std::vector<int16_t> 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<int16_t> runtime(g_FrameLength);
+ std::vector<int16_t> 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<uint32_t> 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 <random>
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<int8_t> 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 <catch.hpp>
void GetExpectedResults(std::vector<std::vector<arm::app::object_detection::DetectionResult>> &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<uint8_t>(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;