18 using Exception::Exception;
24 using InferenceTestImageException::InferenceTestImageException;
30 using InferenceTestImageException::InferenceTestImageException;
36 using InferenceTestImageException::InferenceTestImageException;
42 using InferenceTestImageException::InferenceTestImageException;
48 using InferenceTestImageException::InferenceTestImageException;
65 BilinearAndNormalized,
75 unsigned int GetWidth()
const {
return m_Width; }
78 unsigned int GetNumElements()
const {
return GetWidth() * GetHeight() * GetNumChannels(); }
79 unsigned int GetSizeInBytes()
const {
return GetNumElements() * GetSingleElementSizeInBytes(); }
85 std::tuple<uint8_t, uint8_t, uint8_t> GetPixelAs3Channels(
unsigned int x,
unsigned int y)
const;
87 void StbResize(
InferenceTestImage& im,
const unsigned int newWidth,
const unsigned int newHeight);
90 std::vector<float>
Resize(
unsigned int newWidth,
91 unsigned int newHeight,
94 const std::array<float, 3>& mean = {{0.0, 0.0, 0.0}},
95 const std::array<float, 3>& stddev = {{1.0, 1.0, 1.0}},
96 const float scale = 255.0f);
101 static unsigned int GetSingleElementSizeInBytes()
103 return sizeof(decltype(std::declval<InferenceTestImage>().m_Data[0]));
106 std::vector<uint8_t> m_Data;
107 unsigned int m_Width;
108 unsigned int m_Height;
109 unsigned int m_NumChannels;
139 const std::array<float, 3>& mean);
unsigned int GetNumElements() const
unsigned int GetNumChannels() const
std::vector< float > GetImageDataInArmNnLayoutAsNormalizedFloats(ImageChannelLayout layout, const InferenceTestImage &image)
std::vector< float > GetImageDataInArmNnLayoutAsFloatsSubtractingMean(ImageChannelLayout layout, const InferenceTestImage &image, const std::array< float, 3 > &mean)
unsigned int GetWidth() const
void Resize(Decoder< float > &in, const TensorInfo &inputInfo, Encoder< float > &out, const TensorInfo &outputInfo, DataLayoutIndexed dataLayout, armnn::ResizeMethod resizeMethod, bool alignCorners)
std::vector< float > GetImageDataAsNormalizedFloats(ImageChannelLayout layout, const InferenceTestImage &image)
unsigned int GetSizeInBytes() const
Base class for all ArmNN exceptions so that users can filter to just those.
unsigned int GetHeight() const
long Write(Socket s, const void *buf, size_t len)