aboutsummaryrefslogtreecommitdiff
path: root/samples/ObjectDetection
diff options
context:
space:
mode:
Diffstat (limited to 'samples/ObjectDetection')
-rw-r--r--samples/ObjectDetection/CMakeLists.txt5
-rw-r--r--samples/ObjectDetection/Readme.md5
-rw-r--r--samples/ObjectDetection/cmake/unit_tests.cmake21
-rw-r--r--samples/ObjectDetection/test/PipelineTest.cpp4
4 files changed, 18 insertions, 17 deletions
diff --git a/samples/ObjectDetection/CMakeLists.txt b/samples/ObjectDetection/CMakeLists.txt
index 7e587f7ad3..dbcd55ffbd 100644
--- a/samples/ObjectDetection/CMakeLists.txt
+++ b/samples/ObjectDetection/CMakeLists.txt
@@ -47,7 +47,8 @@ include_directories(../common/include/Utils)
include_directories(../common/include/CVUtils)
file(GLOB SOURCES "src/*.cpp")
-file(GLOB COMMON_SOURCES "../common/src/**/*.cpp")
+file(GLOB CVUTILS_SOURCES "../common/src/CVUtils**/*.cpp")
+file(GLOB UTILS_SOURCES "../common/src/Utils**/*.cpp")
list(REMOVE_ITEM SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/Main.cpp)
file(GLOB TEST_SOURCES "test/*.cpp")
file(GLOB APP_MAIN "src/Main.cpp")
@@ -59,7 +60,7 @@ endif()
set(APP_TARGET_NAME "${CMAKE_PROJECT_NAME}")
-add_executable("${APP_TARGET_NAME}" ${SOURCES} ${COMMON_SOURCES} ${APP_MAIN})
+add_executable("${APP_TARGET_NAME}" ${SOURCES} ${CVUTILS_SOURCES} ${UTILS_SOURCES} ${APP_MAIN})
if (NOT OPENCV_LIBS_FOUND)
message("Building OpenCV libs")
diff --git a/samples/ObjectDetection/Readme.md b/samples/ObjectDetection/Readme.md
index bc53373ce5..ba5883aca9 100644
--- a/samples/ObjectDetection/Readme.md
+++ b/samples/ObjectDetection/Readme.md
@@ -247,8 +247,9 @@ LD_LIBRARY_PATH=/path/to/armnn/libs:/path/to/opencv/libs ./object_detection_exam
--model-name [YOLO_V3_TINY | SSD_MOBILE]
```
-This application has been verified to work against the MobileNet SSD model, which can be downloaded along with it's label set from:
-* https://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip
+This application has been verified to work against the MobileNet SSD and the YOLO V3 tiny models, which can be downloaded along with their label sets from the Arm Model Zoo:
+* https://github.com/ARM-software/ML-zoo/tree/master/models/object_detection/ssd_mobilenet_v1
+* https://github.com/ARM-software/ML-zoo/tree/master/models/object_detection/yolo_v3_tiny
---
diff --git a/samples/ObjectDetection/cmake/unit_tests.cmake b/samples/ObjectDetection/cmake/unit_tests.cmake
index 1a8c466d6b..dd3de708ba 100644
--- a/samples/ObjectDetection/cmake/unit_tests.cmake
+++ b/samples/ObjectDetection/cmake/unit_tests.cmake
@@ -2,6 +2,7 @@
# SPDX-License-Identifier: MIT
set(TEST_RESOURCES_DIR ${CMAKE_SOURCE_DIR}/test/resources)
+file(MAKE_DIRECTORY ${TEST_RESOURCES_DIR})
add_definitions (-DTEST_RESOURCE_DIR="${TEST_RESOURCES_DIR}")
set(TEST_TARGET_NAME "${CMAKE_PROJECT_NAME}-tests")
@@ -9,16 +10,6 @@ file(GLOB TEST_SOURCES "test/*")
include(../common/cmake/find_catch.cmake)
-file(DOWNLOAD "https://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip"
- ${CMAKE_CURRENT_SOURCE_DIR}/test/resources/models.zip SHOW_PROGRESS)
-
-# Extract
-execute_process(
- COMMAND ${CMAKE_COMMAND} -E tar xf models.zip
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test/resources/
- RESULT_VARIABLE return_code
-)
-
ExternalProject_Add(basketball-image
URL https://raw.githubusercontent.com/opencv/opencv/4.0.0/samples/data/basketball1.png
DOWNLOAD_NO_EXTRACT 1
@@ -43,7 +34,15 @@ ExternalProject_Add(vtest
INSTALL_COMMAND ""
)
-add_executable("${TEST_TARGET_NAME}" ${SOURCES} ${TEST_SOURCES} ${COMMON_SOURCES})
+ExternalProject_Add(ssd_mobile
+ URL https://github.com/ARM-software/ML-zoo/raw/master/models/object_detection/ssd_mobilenet_v1/tflite_uint8/ssd_mobilenet_v1.tflite
+ DOWNLOAD_NO_EXTRACT 1
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ${CMAKE_COMMAND} -E copy <DOWNLOAD_DIR>/ssd_mobilenet_v1.tflite ${CMAKE_CURRENT_SOURCE_DIR}/test/resources
+ INSTALL_COMMAND ""
+ )
+
+add_executable("${TEST_TARGET_NAME}" ${SOURCES} ${TEST_SOURCES} ${CVUTILS_SOURCES} ${UTILS_SOURCES})
add_dependencies(
"${TEST_TARGET_NAME}"
diff --git a/samples/ObjectDetection/test/PipelineTest.cpp b/samples/ObjectDetection/test/PipelineTest.cpp
index bc5824e483..7af09007cc 100644
--- a/samples/ObjectDetection/test/PipelineTest.cpp
+++ b/samples/ObjectDetection/test/PipelineTest.cpp
@@ -33,9 +33,9 @@ TEST_CASE("Test Network Execution SSD_MOBILE")
REQUIRE(testResources != "");
// Create the network options
common::PipelineOptions options;
- options.m_ModelFilePath = GetResourceFilePath("detect.tflite");
+ options.m_ModelFilePath = GetResourceFilePath("ssd_mobilenet_v1.tflite");
options.m_ModelName = "SSD_MOBILE";
- options.m_backends = {"CpuAcc", "CpuRef"};
+ options.m_backends = {"CpuRef"};
od::IPipelinePtr objectDetectionPipeline = od::CreatePipeline(options);