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/_image_preprocessor_8hpp_source.xhtml | 123 ++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 21.02/_image_preprocessor_8hpp_source.xhtml (limited to '21.02/_image_preprocessor_8hpp_source.xhtml') diff --git a/21.02/_image_preprocessor_8hpp_source.xhtml b/21.02/_image_preprocessor_8hpp_source.xhtml new file mode 100644 index 0000000000..001ef786c5 --- /dev/null +++ b/21.02/_image_preprocessor_8hpp_source.xhtml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + +ArmNN: tests/ImagePreprocessor.hpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ImagePreprocessor.hpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
8 
9 #include <array>
10 #include <string>
11 #include <vector>
12 #include <memory>
13 
14 ///Tf requires RGB images, normalized in range [0, 1] and resized using Bilinear algorithm
15 
16 
17 using ImageSet = std::pair<const std::string, unsigned int>;
18 
19 template <typename TDataType>
21 {
22 public:
23  using DataType = TDataType;
25 
27  {
30  };
31 
32  explicit ImagePreprocessor(const std::string& binaryFileDirectory,
33  unsigned int width,
34  unsigned int height,
35  const std::vector<ImageSet>& imageSet,
36  float scale=255.0f,
37  const std::array<float, 3> mean={{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  }
52 
53  std::unique_ptr<TTestCaseData> GetTestCaseData(unsigned int testCaseId);
54 
55 private:
56  unsigned int GetNumImageElements() const { return 3 * m_Width * m_Height; }
57  unsigned int GetNumImageBytes() const { return sizeof(DataType) * GetNumImageElements(); }
58  unsigned int GetLabelAndResizedImageAsFloat(unsigned int testCaseId,
59  std::vector<float> & result);
60 
61  std::string m_BinaryDirectory;
62  unsigned int m_Height;
63  unsigned int m_Width;
64  unsigned int m_BatchSize;
65  // Quantization parameters
66  float m_Scale;
67  const std::vector<ImageSet> m_ImageSet;
68 
69  const std::array<float, 3> m_Mean;
70  const std::array<float, 3> m_Stddev;
71 
72  DataFormat m_DataFormat;
73 };
+
std::pair< const std::string, unsigned int > ImageSet
Caffe requires BGR images, not normalized, mean adjusted and resized using smooth resize of STB libra...
+
std::unique_ptr< TTestCaseData > GetTestCaseData(unsigned int testCaseId)
+ + +
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)
+ + + + +
+
+ + + + -- cgit v1.2.1