aboutsummaryrefslogtreecommitdiff
path: root/tests/YoloDatabase.hpp
diff options
context:
space:
mode:
authortelsoa01 <telmo.soares@arm.com>2018-03-09 14:13:49 +0000
committertelsoa01 <telmo.soares@arm.com>2018-03-09 14:13:49 +0000
commit4fcda0101ec3d110c1d6d7bee5c83416b645528a (patch)
treec9a70aeb2887006160c1b3d265c27efadb7bdbae /tests/YoloDatabase.hpp
downloadarmnn-4fcda0101ec3d110c1d6d7bee5c83416b645528a.tar.gz
Release 18.02
Change-Id: Id3c11dc5ee94ef664374a988fcc6901e9a232fa6
Diffstat (limited to 'tests/YoloDatabase.hpp')
-rw-r--r--tests/YoloDatabase.hpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/YoloDatabase.hpp b/tests/YoloDatabase.hpp
new file mode 100644
index 0000000000..3656e26a94
--- /dev/null
+++ b/tests/YoloDatabase.hpp
@@ -0,0 +1,63 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// See LICENSE file in the project root for full license information.
+//
+#pragma once
+
+#include "ClassifierTestCaseData.hpp"
+
+#include <array>
+#include <string>
+#include <memory>
+
+struct YoloBoundingBox
+{
+ float m_X;
+ float m_Y;
+ float m_W;
+ float m_H;
+};
+
+struct YoloDetectedObject
+{
+ YoloDetectedObject(unsigned int yoloClass,
+ const YoloBoundingBox& box,
+ float confidence)
+ : m_Class(yoloClass)
+ , m_Box(box)
+ , m_Confidence(confidence)
+ {}
+
+ unsigned int m_Class;
+ YoloBoundingBox m_Box;
+ float m_Confidence;
+};
+
+class YoloTestCaseData
+{
+public:
+ YoloTestCaseData(std::vector<float> inputImage,
+ std::vector<YoloDetectedObject> topObjectDetections)
+ : m_InputImage(std::move(inputImage))
+ , m_TopObjectDetections(std::move(topObjectDetections))
+ {
+ }
+
+ std::vector<float> m_InputImage;
+ std::vector<YoloDetectedObject> m_TopObjectDetections;
+};
+
+constexpr unsigned int YoloImageWidth = 448;
+constexpr unsigned int YoloImageHeight = 448;
+
+class YoloDatabase
+{
+public:
+ using TTestCaseData = YoloTestCaseData;
+
+ explicit YoloDatabase(const std::string& imageDir);
+ std::unique_ptr<TTestCaseData> GetTestCaseData(unsigned int testCaseId);
+
+private:
+ std::string m_ImageDir;
+};