blob: 220262c522287d3756d00a0b99a0a5d555a93da3 [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5#pragma once
6
7#include "ClassifierTestCaseData.hpp"
8
9#include <array>
10#include <string>
11#include <memory>
12
13struct YoloBoundingBox
14{
15 float m_X;
16 float m_Y;
17 float m_W;
18 float m_H;
19};
20
21struct YoloDetectedObject
22{
23 YoloDetectedObject(unsigned int yoloClass,
24 const YoloBoundingBox& box,
25 float confidence)
26 : m_Class(yoloClass)
27 , m_Box(box)
28 , m_Confidence(confidence)
29 {}
30
31 unsigned int m_Class;
32 YoloBoundingBox m_Box;
33 float m_Confidence;
34};
35
36class YoloTestCaseData
37{
38public:
39 YoloTestCaseData(std::vector<float> inputImage,
40 std::vector<YoloDetectedObject> topObjectDetections)
41 : m_InputImage(std::move(inputImage))
42 , m_TopObjectDetections(std::move(topObjectDetections))
43 {
44 }
45
46 std::vector<float> m_InputImage;
47 std::vector<YoloDetectedObject> m_TopObjectDetections;
48};
49
50constexpr unsigned int YoloImageWidth = 448;
51constexpr unsigned int YoloImageHeight = 448;
52
53class YoloDatabase
54{
55public:
56 using TTestCaseData = YoloTestCaseData;
57
58 explicit YoloDatabase(const std::string& imageDir);
59 std::unique_ptr<TTestCaseData> GetTestCaseData(unsigned int testCaseId);
60
61private:
62 std::string m_ImageDir;
63};