From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- 21.02/_inference_test_image_8hpp.xhtml | 345 +++++++++++++++++++++++++++++++++ 1 file changed, 345 insertions(+) create mode 100644 21.02/_inference_test_image_8hpp.xhtml (limited to '21.02/_inference_test_image_8hpp.xhtml') diff --git a/21.02/_inference_test_image_8hpp.xhtml b/21.02/_inference_test_image_8hpp.xhtml new file mode 100644 index 0000000000..311dad91b0 --- /dev/null +++ b/21.02/_inference_test_image_8hpp.xhtml @@ -0,0 +1,345 @@ + + + + + + + + + + + + + +ArmNN: tests/InferenceTestImage.hpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
InferenceTestImage.hpp File Reference
+
+
+
#include <armnn/Exceptions.hpp>
+#include <VerificationHelpers.hpp>
+#include <array>
+#include <cstdint>
+#include <vector>
+#include <utility>
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + +

+Classes

class  InferenceTestImageException
 
class  InferenceTestImageLoadFailed
 
class  InferenceTestImageOutOfBoundsAccess
 
class  InferenceTestImageResizeFailed
 
class  InferenceTestImageWriteFailed
 
class  UnknownImageChannelLayout
 
class  InferenceTestImage
 
+ + + + + +

+Enumerations

enum  ImageChannel { R, +G, +B + }
 
enum  ImageChannelLayout { Rgb, +Bgr + }
 
+ + + + + + + +

+Functions

std::vector< float > GetImageDataInArmNnLayoutAsNormalizedFloats (ImageChannelLayout layout, const InferenceTestImage &image)
 
std::vector< float > GetImageDataInArmNnLayoutAsFloatsSubtractingMean (ImageChannelLayout layout, const InferenceTestImage &image, const std::array< float, 3 > &mean)
 
std::vector< float > GetImageDataAsNormalizedFloats (ImageChannelLayout layout, const InferenceTestImage &image)
 
+

Enumeration Type Documentation

+ +

◆ ImageChannel

+ +
+
+ + + + + +
+ + + + +
enum ImageChannel
+
+strong
+
+ + + + +
Enumerator
+ +

Definition at line 113 of file InferenceTestImage.hpp.

+
114 {
115  R,
116  G,
117  B
118 };
+ + +
+
+
+ +

◆ ImageChannelLayout

+ +
+
+ + + + + +
+ + + + +
enum ImageChannelLayout
+
+strong
+
+ + + +
Enumerator
Rgb 
Bgr 
+ +

Definition at line 121 of file InferenceTestImage.hpp.

+ +
+
+

Function Documentation

+ +

◆ GetImageDataAsNormalizedFloats()

+ +
+
+ + + + + + + + + + + + + + + + + + +
std::vector<float> GetImageDataAsNormalizedFloats (ImageChannelLayout layout,
const InferenceTestImageimage 
)
+
+ +

Definition at line 333 of file InferenceTestImage.cpp.

+ +

References B, G, InferenceTestImage::GetHeight(), InferenceTestImage::GetPixelAs3Channels(), InferenceTestImage::GetWidth(), and R.

+
335 {
336  std::vector<float> imageData;
337  const unsigned int h = image.GetHeight();
338  const unsigned int w = image.GetWidth();
339 
340  const unsigned int rDstIndex = GetImageChannelIndex(layout, ImageChannel::R);
341  const unsigned int gDstIndex = GetImageChannelIndex(layout, ImageChannel::G);
342  const unsigned int bDstIndex = GetImageChannelIndex(layout, ImageChannel::B);
343 
344  imageData.resize(h * w * 3);
345  unsigned int offset = 0;
346 
347  for (unsigned int j = 0; j < h; ++j)
348  {
349  for (unsigned int i = 0; i < w; ++i)
350  {
351  uint8_t r, g, b;
352  std::tie(r, g, b) = image.GetPixelAs3Channels(i, j);
353 
354  imageData[offset+rDstIndex] = float(r) / 255.0f;
355  imageData[offset+gDstIndex] = float(g) / 255.0f;
356  imageData[offset+bDstIndex] = float(b) / 255.0f;
357  offset += 3;
358  }
359  }
360 
361  return imageData;
362 }
+ + +
unsigned int GetWidth() const
+
std::tuple< uint8_t, uint8_t, uint8_t > GetPixelAs3Channels(unsigned int x, unsigned int y) const
+
unsigned int GetHeight() const
+
+
+
+ +

◆ GetImageDataInArmNnLayoutAsFloatsSubtractingMean()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::vector<float> GetImageDataInArmNnLayoutAsFloatsSubtractingMean (ImageChannelLayout layout,
const InferenceTestImageimage,
const std::array< float, 3 > & mean 
)
+
+ +

Definition at line 321 of file InferenceTestImage.cpp.

+ +

References GetImageDataInArmNnLayoutAsFloats().

+ +

Referenced by CaffePreprocessor::GetTestCaseData().

+
324 {
325  return GetImageDataInArmNnLayoutAsFloats(layout, image,
326  [layout, &mean](ImageChannel channel, float value)
327  {
328  const unsigned int channelIndex = GetImageChannelIndex(layout, channel);
329  return value - mean[channelIndex];
330  });
331 }
+
std::vector< float > GetImageDataInArmNnLayoutAsFloats(ImageChannelLayout channelLayout, const InferenceTestImage &image, TProcessValueCallable processValue)
+
+
+
+ +

◆ GetImageDataInArmNnLayoutAsNormalizedFloats()

+ +
+
+ + + + + + + + + + + + + + + + + + +
std::vector<float> GetImageDataInArmNnLayoutAsNormalizedFloats (ImageChannelLayout layout,
const InferenceTestImageimage 
)
+
+ +

Definition at line 310 of file InferenceTestImage.cpp.

+ +

References GetImageDataInArmNnLayoutAsFloats(), and armnn::IgnoreUnused().

+ +

Referenced by YoloDatabase::GetTestCaseData().

+
312 {
313  return GetImageDataInArmNnLayoutAsFloats(layout, image,
314  [](ImageChannel channel, float value)
315  {
316  armnn::IgnoreUnused(channel);
317  return value / 255.f;
318  });
319 }
void IgnoreUnused(Ts &&...)
+ +
std::vector< float > GetImageDataInArmNnLayoutAsFloats(ImageChannelLayout channelLayout, const InferenceTestImage &image, TProcessValueCallable processValue)
+
+
+
+
+
+ + + + -- cgit v1.2.1