summaryrefslogtreecommitdiff
path: root/tests/use_case/object_detection
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/use_case/object_detection
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/use_case/object_detection')
-rw-r--r--tests/use_case/object_detection/InferenceTestYoloFastest.cc19
-rw-r--r--tests/use_case/object_detection/ObjectDetectionUCTest.cc31
2 files changed, 26 insertions, 24 deletions
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;