surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // See LICENSE file in the project root for full license information. |
| 4 | // |
| 5 | #pragma once |
| 6 | |
| 7 | #include "ClassifierTestCaseData.hpp" |
| 8 | |
| 9 | #include <array> |
| 10 | #include <string> |
| 11 | #include <vector> |
| 12 | #include <memory> |
| 13 | |
| 14 | using ImageSet = std::pair<const std::string, unsigned int>; |
| 15 | |
| 16 | class MobileNetDatabase |
| 17 | { |
| 18 | public: |
| 19 | using TTestCaseData = ClassifierTestCaseData<float>; |
| 20 | |
| 21 | explicit MobileNetDatabase(const std::string& binaryFileDirectory, |
| 22 | unsigned int width, |
| 23 | unsigned int height, |
| 24 | const std::vector<ImageSet>& imageSet); |
| 25 | |
| 26 | std::unique_ptr<TTestCaseData> GetTestCaseData(unsigned int testCaseId); |
| 27 | |
| 28 | private: |
| 29 | unsigned int GetNumImageElements() const { return 3 * m_Width * m_Height; } |
| 30 | unsigned int GetNumImageBytes() const { return 4 * GetNumImageElements(); } |
| 31 | |
| 32 | std::string m_BinaryDirectory; |
| 33 | unsigned int m_Height; |
| 34 | unsigned int m_Width; |
| 35 | const std::vector<ImageSet> m_ImageSet; |
| 36 | }; |