46 constexpr
auto to_underlying(E e) noexcept
48 return static_cast<std::underlying_type_t<E>
>(e);
53 using Exception::Exception;
56 using YoloInputOutput = std::pair<const char* const, YoloDetectedObject>;
58 const std::array<YoloInputOutput,1> g_PerTestCaseInputOutput =
61 "yolo_dog_448x448.png",
62 { to_underlying(YoloVocClass::Dog),
YoloBoundingBox{ 233.0f, 256.0f, 299.0f, 462.0f }, 0.5088733434677124f }
69 : m_ImageDir(imageDir)
75 testCaseId = testCaseId %
armnn::numeric_cast<
unsigned int>(g_PerTestCaseInputOutput.size());
76 const auto& testCaseInputOutput = g_PerTestCaseInputOutput[testCaseId];
77 const std::string imagePath = m_ImageDir + testCaseInputOutput.first;
80 std::vector<float> imageData;
92 ARMNN_LOG(fatal) <<
"Failed to load test case " << testCaseId <<
" with error: " << e.
what();
97 std::vector<YoloDetectedObject> topObjectDetections;
98 topObjectDetections.reserve(1);
99 topObjectDetections.push_back(testCaseInputOutput.second);
101 return std::make_unique<YoloTestCaseData>(std::move(imageData), std::move(topObjectDetections));
constexpr unsigned int YoloImageHeight
virtual const char * what() const noexcept override
#define ARMNN_LOG(severity)
std::vector< float > GetImageDataInArmNnLayoutAsNormalizedFloats(ImageChannelLayout layout, const InferenceTestImage &image)
YoloDatabase(const std::string &imageDir)
std::unique_ptr< TTestCaseData > GetTestCaseData(unsigned int testCaseId)
Base class for all ArmNN exceptions so that users can filter to just those.
constexpr unsigned int YoloImageWidth
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
std::vector< float > Resize(unsigned int newWidth, unsigned int newHeight, const armnn::CheckLocation &location, const ResizingMethods meth=ResizingMethods::STB, const std::array< float, 3 > &mean={{0.0, 0.0, 0.0}}, const std::array< float, 3 > &stddev={{1.0, 1.0, 1.0}}, const float scale=255.0f)