aboutsummaryrefslogtreecommitdiff
path: root/src/armnnTfLiteParser/test/DetectionPostProcess.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnnTfLiteParser/test/DetectionPostProcess.cpp')
-rw-r--r--src/armnnTfLiteParser/test/DetectionPostProcess.cpp72
1 files changed, 35 insertions, 37 deletions
diff --git a/src/armnnTfLiteParser/test/DetectionPostProcess.cpp b/src/armnnTfLiteParser/test/DetectionPostProcess.cpp
index 304520c24f..e7ef7402f2 100644
--- a/src/armnnTfLiteParser/test/DetectionPostProcess.cpp
+++ b/src/armnnTfLiteParser/test/DetectionPostProcess.cpp
@@ -12,10 +12,8 @@
#include <armnn/utility/PolymorphicDowncast.hpp>
#include <QuantizeHelper.hpp>
-#include <boost/test/unit_test.hpp>
-
-BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
-
+TEST_SUITE("TensorflowLiteParser_DetectionPostProcess")
+{
struct DetectionPostProcessFixture : ParserFlatbuffersFixture
{
explicit DetectionPostProcessFixture(const std::string& custom_options)
@@ -161,7 +159,7 @@ public:
{}
};
-BOOST_FIXTURE_TEST_CASE( ParseDetectionPostProcess, ParseDetectionPostProcessCustomOptions )
+TEST_CASE_FIXTURE(ParseDetectionPostProcessCustomOptions, "ParseDetectionPostProcess")
{
Setup();
@@ -223,7 +221,7 @@ BOOST_FIXTURE_TEST_CASE( ParseDetectionPostProcess, ParseDetectionPostProcessCus
RunTest<armnn::DataType::QAsymmU8, armnn::DataType::Float32>(0, input, output);
}
-BOOST_FIXTURE_TEST_CASE(DetectionPostProcessGraphStructureTest, ParseDetectionPostProcessCustomOptions)
+TEST_CASE_FIXTURE(ParseDetectionPostProcessCustomOptions, "DetectionPostProcessGraphStructureTest")
{
/*
Inputs: box_encodings scores
@@ -244,47 +242,47 @@ BOOST_FIXTURE_TEST_CASE(DetectionPostProcessGraphStructureTest, ParseDetectionPo
armnn::Graph& graph = GetGraphForTesting(optimized.get());
// Check the number of layers in the graph
- BOOST_TEST((graph.GetNumInputs() == 2));
- BOOST_TEST((graph.GetNumOutputs() == 4));
- BOOST_TEST((graph.GetNumLayers() == 7));
+ CHECK((graph.GetNumInputs() == 2));
+ CHECK((graph.GetNumOutputs() == 4));
+ CHECK((graph.GetNumLayers() == 7));
// Input layers
armnn::Layer* boxEncodingLayer = GetFirstLayerWithName(graph, "box_encodings");
- BOOST_TEST((boxEncodingLayer->GetType() == armnn::LayerType::Input));
- BOOST_TEST(CheckNumberOfInputSlot(boxEncodingLayer, 0));
- BOOST_TEST(CheckNumberOfOutputSlot(boxEncodingLayer, 1));
+ CHECK((boxEncodingLayer->GetType() == armnn::LayerType::Input));
+ CHECK(CheckNumberOfInputSlot(boxEncodingLayer, 0));
+ CHECK(CheckNumberOfOutputSlot(boxEncodingLayer, 1));
armnn::Layer* scoresLayer = GetFirstLayerWithName(graph, "scores");
- BOOST_TEST((scoresLayer->GetType() == armnn::LayerType::Input));
- BOOST_TEST(CheckNumberOfInputSlot(scoresLayer, 0));
- BOOST_TEST(CheckNumberOfOutputSlot(scoresLayer, 1));
+ CHECK((scoresLayer->GetType() == armnn::LayerType::Input));
+ CHECK(CheckNumberOfInputSlot(scoresLayer, 0));
+ CHECK(CheckNumberOfOutputSlot(scoresLayer, 1));
// DetectionPostProcess layer
armnn::Layer* detectionPostProcessLayer = GetFirstLayerWithName(graph, "DetectionPostProcess:0:0");
- BOOST_TEST((detectionPostProcessLayer->GetType() == armnn::LayerType::DetectionPostProcess));
- BOOST_TEST(CheckNumberOfInputSlot(detectionPostProcessLayer, 2));
- BOOST_TEST(CheckNumberOfOutputSlot(detectionPostProcessLayer, 4));
+ CHECK((detectionPostProcessLayer->GetType() == armnn::LayerType::DetectionPostProcess));
+ CHECK(CheckNumberOfInputSlot(detectionPostProcessLayer, 2));
+ CHECK(CheckNumberOfOutputSlot(detectionPostProcessLayer, 4));
// Output layers
armnn::Layer* detectionBoxesLayer = GetFirstLayerWithName(graph, "detection_boxes");
- BOOST_TEST((detectionBoxesLayer->GetType() == armnn::LayerType::Output));
- BOOST_TEST(CheckNumberOfInputSlot(detectionBoxesLayer, 1));
- BOOST_TEST(CheckNumberOfOutputSlot(detectionBoxesLayer, 0));
+ CHECK((detectionBoxesLayer->GetType() == armnn::LayerType::Output));
+ CHECK(CheckNumberOfInputSlot(detectionBoxesLayer, 1));
+ CHECK(CheckNumberOfOutputSlot(detectionBoxesLayer, 0));
armnn::Layer* detectionClassesLayer = GetFirstLayerWithName(graph, "detection_classes");
- BOOST_TEST((detectionClassesLayer->GetType() == armnn::LayerType::Output));
- BOOST_TEST(CheckNumberOfInputSlot(detectionClassesLayer, 1));
- BOOST_TEST(CheckNumberOfOutputSlot(detectionClassesLayer, 0));
+ CHECK((detectionClassesLayer->GetType() == armnn::LayerType::Output));
+ CHECK(CheckNumberOfInputSlot(detectionClassesLayer, 1));
+ CHECK(CheckNumberOfOutputSlot(detectionClassesLayer, 0));
armnn::Layer* detectionScoresLayer = GetFirstLayerWithName(graph, "detection_scores");
- BOOST_TEST((detectionScoresLayer->GetType() == armnn::LayerType::Output));
- BOOST_TEST(CheckNumberOfInputSlot(detectionScoresLayer, 1));
- BOOST_TEST(CheckNumberOfOutputSlot(detectionScoresLayer, 0));
+ CHECK((detectionScoresLayer->GetType() == armnn::LayerType::Output));
+ CHECK(CheckNumberOfInputSlot(detectionScoresLayer, 1));
+ CHECK(CheckNumberOfOutputSlot(detectionScoresLayer, 0));
armnn::Layer* numDetectionsLayer = GetFirstLayerWithName(graph, "num_detections");
- BOOST_TEST((numDetectionsLayer->GetType() == armnn::LayerType::Output));
- BOOST_TEST(CheckNumberOfInputSlot(numDetectionsLayer, 1));
- BOOST_TEST(CheckNumberOfOutputSlot(numDetectionsLayer, 0));
+ CHECK((numDetectionsLayer->GetType() == armnn::LayerType::Output));
+ CHECK(CheckNumberOfInputSlot(numDetectionsLayer, 1));
+ CHECK(CheckNumberOfOutputSlot(numDetectionsLayer, 0));
// Check the connections
armnn::TensorInfo boxEncodingTensor(armnn::TensorShape({ 1, 6, 4 }), armnn::DataType::QAsymmU8, 1, 1);
@@ -296,12 +294,12 @@ BOOST_FIXTURE_TEST_CASE(DetectionPostProcessGraphStructureTest, ParseDetectionPo
armnn::TensorInfo detectionScoresTensor(armnn::TensorShape({ 1, 3 }), armnn::DataType::Float32, 0, 0);
armnn::TensorInfo numDetectionsTensor(armnn::TensorShape({ 1} ), armnn::DataType::Float32, 0, 0);
- BOOST_TEST(IsConnected(boxEncodingLayer, detectionPostProcessLayer, 0, 0, boxEncodingTensor));
- BOOST_TEST(IsConnected(scoresLayer, detectionPostProcessLayer, 0, 1, scoresTensor));
- BOOST_TEST(IsConnected(detectionPostProcessLayer, detectionBoxesLayer, 0, 0, detectionBoxesTensor));
- BOOST_TEST(IsConnected(detectionPostProcessLayer, detectionClassesLayer, 1, 0, detectionClassesTensor));
- BOOST_TEST(IsConnected(detectionPostProcessLayer, detectionScoresLayer, 2, 0, detectionScoresTensor));
- BOOST_TEST(IsConnected(detectionPostProcessLayer, numDetectionsLayer, 3, 0, numDetectionsTensor));
+ CHECK(IsConnected(boxEncodingLayer, detectionPostProcessLayer, 0, 0, boxEncodingTensor));
+ CHECK(IsConnected(scoresLayer, detectionPostProcessLayer, 0, 1, scoresTensor));
+ CHECK(IsConnected(detectionPostProcessLayer, detectionBoxesLayer, 0, 0, detectionBoxesTensor));
+ CHECK(IsConnected(detectionPostProcessLayer, detectionClassesLayer, 1, 0, detectionClassesTensor));
+ CHECK(IsConnected(detectionPostProcessLayer, detectionScoresLayer, 2, 0, detectionScoresTensor));
+ CHECK(IsConnected(detectionPostProcessLayer, numDetectionsLayer, 3, 0, numDetectionsTensor));
}
-BOOST_AUTO_TEST_SUITE_END()
+}