From 25d80eed552df4d0346d1f245d1e6264d7b477f3 Mon Sep 17 00:00:00 2001 From: Colm Donelan Date: Fri, 30 Oct 2020 14:46:21 +0000 Subject: IVGCVSW-5265 Removing more Boost references from test executables. * Removed unused includes from InferenceModel.hpp. * Replaced use of boost multi-array with vectors in YoloInferenceTest. Signed-off-by: Colm Donelan Change-Id: Ieadf3471ed170b09859187c83616c8e249f94543 --- tests/InferenceModel.hpp | 2 -- tests/YoloInferenceTest.hpp | 43 +++++++++++++++++++++---------------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/tests/InferenceModel.hpp b/tests/InferenceModel.hpp index dbc0419191..1b87a10de1 100644 --- a/tests/InferenceModel.hpp +++ b/tests/InferenceModel.hpp @@ -27,8 +27,6 @@ #include #include "armnn/utility/StringUtils.hpp" -#include -#include #include #include "CxxoptsUtils.hpp" #include diff --git a/tests/YoloInferenceTest.hpp b/tests/YoloInferenceTest.hpp index cb1817a0bb..1629de1bf4 100644 --- a/tests/YoloInferenceTest.hpp +++ b/tests/YoloInferenceTest.hpp @@ -11,7 +11,6 @@ #include #include -#include #include #include #include @@ -34,24 +33,23 @@ public: { armnn::IgnoreUnused(options); - using Boost3dArray = boost::multi_array; - const std::vector& output = mapbox::util::get>(this->GetOutputs()[0]); ARMNN_ASSERT(output.size() == YoloOutputSize); - constexpr Boost3dArray::index gridSize = 7; - constexpr Boost3dArray::index numClasses = 20; - constexpr Boost3dArray::index numScales = 2; + constexpr unsigned int gridSize = 7; + constexpr unsigned int numClasses = 20; + constexpr unsigned int numScales = 2; const float* outputPtr = output.data(); // Range 0-980. Class probabilities. 7x7x20 - Boost3dArray classProbabilities(boost::extents[gridSize][gridSize][numClasses]); - for (Boost3dArray::index y = 0; y < gridSize; ++y) + vector>> classProbabilities(gridSize, vector>(gridSize, + vector(numClasses))); + for (unsigned int y = 0; y < gridSize; ++y) { - for (Boost3dArray::index x = 0; x < gridSize; ++x) + for (unsigned int x = 0; x < gridSize; ++x) { - for (Boost3dArray::index c = 0; c < numClasses; ++c) + for (unsigned int c = 0; c < numClasses; ++c) { classProbabilities[y][x][c] = *outputPtr++; } @@ -59,12 +57,12 @@ public: } // Range 980-1078. Scales. 7x7x2 - Boost3dArray scales(boost::extents[gridSize][gridSize][numScales]); - for (Boost3dArray::index y = 0; y < gridSize; ++y) + vector>> scales(gridSize, vector>(gridSize, vector(numScales))); + for (unsigned int y = 0; y < gridSize; ++y) { - for (Boost3dArray::index x = 0; x < gridSize; ++x) + for (unsigned int x = 0; x < gridSize; ++x) { - for (Boost3dArray::index s = 0; s < numScales; ++s) + for (unsigned int s = 0; s < numScales; ++s) { scales[y][x][s] = *outputPtr++; } @@ -75,12 +73,13 @@ public: constexpr float imageWidthAsFloat = static_cast(YoloImageWidth); constexpr float imageHeightAsFloat = static_cast(YoloImageHeight); - boost::multi_array boxes(boost::extents[gridSize][gridSize][numScales][4]); - for (Boost3dArray::index y = 0; y < gridSize; ++y) + vector>>> boxes(gridSize, vector>> + (gridSize, vector>(numScales, vector(4)))); + for (unsigned int y = 0; y < gridSize; ++y) { - for (Boost3dArray::index x = 0; x < gridSize; ++x) + for (unsigned int x = 0; x < gridSize; ++x) { - for (Boost3dArray::index s = 0; s < numScales; ++s) + for (unsigned int s = 0; s < numScales; ++s) { float bx = *outputPtr++; float by = *outputPtr++; @@ -99,13 +98,13 @@ public: std::vector detectedObjects; detectedObjects.reserve(gridSize * gridSize * numScales * numClasses); - for (Boost3dArray::index y = 0; y < gridSize; ++y) + for (unsigned int y = 0; y < gridSize; ++y) { - for (Boost3dArray::index x = 0; x < gridSize; ++x) + for (unsigned int x = 0; x < gridSize; ++x) { - for (Boost3dArray::index s = 0; s < numScales; ++s) + for (unsigned int s = 0; s < numScales; ++s) { - for (Boost3dArray::index c = 0; c < numClasses; ++c) + for (unsigned int c = 0; c < numClasses; ++c) { // Resolved confidence: class probabilities * scales. const float confidence = classProbabilities[y][x][c] * scales[y][x][s]; -- cgit v1.2.1