From add078b7f9a658d52ee6e8fe6771ea0517c07674 Mon Sep 17 00:00:00 2001 From: mathad01 Date: Mon, 10 May 2021 16:51:20 +0100 Subject: IVGCVSW-5908 Update 21.05 Doxygen Documents Signed-off-by: mathad01 Change-Id: I95316d4fc5f9d10185492dc835bb2411c1daea7b --- 21.05/class_image_preprocessor.xhtml | 355 +++++++++++++++++++++++++++++++++++ 1 file changed, 355 insertions(+) create mode 100644 21.05/class_image_preprocessor.xhtml (limited to '21.05/class_image_preprocessor.xhtml') diff --git a/21.05/class_image_preprocessor.xhtml b/21.05/class_image_preprocessor.xhtml new file mode 100644 index 0000000000..7c147082cb --- /dev/null +++ b/21.05/class_image_preprocessor.xhtml @@ -0,0 +1,355 @@ + + + + + + + + + + + + + +ArmNN: ImagePreprocessor< TDataType > Class Template Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.05 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
ImagePreprocessor< TDataType > Class Template Reference
+
+
+ +

#include <ImagePreprocessor.hpp>

+ + + + + + + + +

+Public Types

enum  DataFormat { NHWC, +NCHW + }
 
using DataType = TDataType
 
using TTestCaseData = ClassifierTestCaseData< DataType >
 
+ + + + + + + + + + + +

+Public Member Functions

 ImagePreprocessor (const std::string &binaryFileDirectory, unsigned int width, unsigned int height, const std::vector< ImageSet > &imageSet, float scale=255.0f, const std::array< float, 3 > mean={{0, 0, 0}}, const std::array< float, 3 > stddev={{1, 1, 1}}, DataFormat dataFormat=DataFormat::NHWC, unsigned int batchSize=1)
 
std::unique_ptr< TTestCaseDataGetTestCaseData (unsigned int testCaseId)
 
template<>
std::unique_ptr< ImagePreprocessor< float >::TTestCaseDataGetTestCaseData (unsigned int testCaseId)
 
template<>
std::unique_ptr< ImagePreprocessor< uint8_t >::TTestCaseDataGetTestCaseData (unsigned int testCaseId)
 
+

Detailed Description

+

template<typename TDataType>
+class ImagePreprocessor< TDataType >

+ + +

Definition at line 20 of file ImagePreprocessor.hpp.

+

Member Typedef Documentation

+ +

◆ DataType

+ +
+
+ + + + +
using DataType = TDataType
+
+ +

Definition at line 23 of file ImagePreprocessor.hpp.

+ +
+
+ +

◆ TTestCaseData

+ +
+
+ +

Definition at line 24 of file ImagePreprocessor.hpp.

+ +
+
+

Member Enumeration Documentation

+ +

◆ DataFormat

+ +
+
+ + + + +
enum DataFormat
+
+ + + +
Enumerator
NHWC 
NCHW 
+ +

Definition at line 26 of file ImagePreprocessor.hpp.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ ImagePreprocessor()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ImagePreprocessor (const std::string & binaryFileDirectory,
unsigned int width,
unsigned int height,
const std::vector< ImageSet > & imageSet,
float scale = 255.0f,
const std::array< float, 3 > mean = {{0, 0, 0}},
const std::array< float, 3 > stddev = {{1, 1, 1}},
DataFormat dataFormat = DataFormat::NHWC,
unsigned int batchSize = 1 
)
+
+inlineexplicit
+
+ +

Definition at line 32 of file ImagePreprocessor.hpp.

+ +

References ImagePreprocessor< TDataType >::GetTestCaseData().

+
37  {{0, 0, 0}},
38  const std::array<float, 3> stddev={{1, 1, 1}},
39  DataFormat dataFormat=DataFormat::NHWC,
40  unsigned int batchSize=1)
41  : m_BinaryDirectory(binaryFileDirectory)
42  , m_Height(height)
43  , m_Width(width)
44  , m_BatchSize(batchSize)
45  , m_Scale(scale)
46  , m_ImageSet(imageSet)
47  , m_Mean(mean)
48  , m_Stddev(stddev)
49  , m_DataFormat(dataFormat)
50  {
51  }
+
+
+
+

Member Function Documentation

+ +

◆ GetTestCaseData() [1/3]

+ +
+
+ + + + + + + + +
std::unique_ptr<TTestCaseData> GetTestCaseData (unsigned int testCaseId)
+
+
+ +

◆ GetTestCaseData() [2/3]

+ +
+
+ + + + + + + + +
std::unique_ptr< ImagePreprocessor< float >::TTestCaseData > GetTestCaseData (unsigned int testCaseId)
+
+ +

Definition at line 56 of file ImagePreprocessor.cpp.

+
57 {
58  std::vector<float> resized;
59  auto label = GetLabelAndResizedImageAsFloat(testCaseId, resized);
60  return std::make_unique<TTestCaseData>(label, std::move(resized));
61 }
+
+
+ +

◆ GetTestCaseData() [3/3]

+ +
+
+ + + + + + + + +
std::unique_ptr< ImagePreprocessor< uint8_t >::TTestCaseData > GetTestCaseData (unsigned int testCaseId)
+
+ +

Definition at line 65 of file ImagePreprocessor.cpp.

+
66 {
67  std::vector<float> resized;
68  auto label = GetLabelAndResizedImageAsFloat(testCaseId, resized);
69 
70  size_t resizedSize = resized.size();
71  std::vector<uint8_t> quantized(resized.size());
72 
73  for (size_t i=0; i<resizedSize; ++i)
74  {
75  quantized[i] = static_cast<uint8_t>(resized[i]);
76  }
77 
78  return std::make_unique<TTestCaseData>(label, std::move(quantized));
79 }
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1