From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/class_caffe_preprocessor.xhtml | 256 +++++++++++++++++++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 20.02/class_caffe_preprocessor.xhtml (limited to '20.02/class_caffe_preprocessor.xhtml') diff --git a/20.02/class_caffe_preprocessor.xhtml b/20.02/class_caffe_preprocessor.xhtml new file mode 100644 index 0000000000..74f11e40b9 --- /dev/null +++ b/20.02/class_caffe_preprocessor.xhtml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + +ArmNN: CaffePreprocessor Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
CaffePreprocessor Class Reference
+
+
+ +

#include <CaffePreprocessor.hpp>

+ + + + + + +

+Public Types

using DataType = float
 
using TTestCaseData = ClassifierTestCaseData< DataType >
 
+ + + + + +

+Public Member Functions

 CaffePreprocessor (const std::string &binaryFileDirectory, unsigned int width=227, unsigned int height=227, const std::vector< ImageSet > &imageSet=std::vector< ImageSet >())
 
std::unique_ptr< TTestCaseDataGetTestCaseData (unsigned int testCaseId)
 
+

Detailed Description

+
+

Definition at line 18 of file CaffePreprocessor.hpp.

+

Member Typedef Documentation

+ +

◆ DataType

+ +
+
+ + + + +
using DataType = float
+
+ +

Definition at line 21 of file CaffePreprocessor.hpp.

+ +
+
+ +

◆ TTestCaseData

+ +
+
+ +

Definition at line 22 of file CaffePreprocessor.hpp.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ CaffePreprocessor()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaffePreprocessor (const std::string & binaryFileDirectory,
unsigned int width = 227,
unsigned int height = 227,
const std::vector< ImageSet > & imageSet = std::vector<ImageSet>() 
)
+
+explicit
+
+ +

Definition at line 21 of file CaffePreprocessor.cpp.

+
23 : m_BinaryDirectory(binaryFileDirectory)
24 , m_Height(height)
25 , m_Width(width)
26 , m_ImageSet(imageSet.empty() ? g_DefaultImageSet : imageSet)
27 {
28 }
const std::vector< ImageSet > g_DefaultImageSet
+
+
+
+

Member Function Documentation

+ +

◆ GetTestCaseData()

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

Definition at line 30 of file CaffePreprocessor.cpp.

+ +

References Bgr, CHECK_LOCATION, GetImageDataInArmNnLayoutAsFloatsSubtractingMean(), armnn::numeric_cast(), and InferenceTestImage::Resize().

+
31 {
32  testCaseId = testCaseId % boost::numeric_cast<unsigned int>(m_ImageSet.size());
33  const ImageSet& imageSet = m_ImageSet[testCaseId];
34  const std::string fullPath = m_BinaryDirectory + imageSet.first;
35 
36  InferenceTestImage image(fullPath.c_str());
37  image.Resize(m_Width, m_Height, CHECK_LOCATION());
38 
39  // The model expects image data in BGR format.
41  image, m_MeanBgr);
42 
43  // List of labels: https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a
44  const unsigned int label = imageSet.second;
45  return std::make_unique<TTestCaseData>(label, std::move(inputImageData));
46 }
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::vector< float > GetImageDataInArmNnLayoutAsFloatsSubtractingMean(ImageChannelLayout layout, const InferenceTestImage &image, const std::array< float, 3 > &mean)
+
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
Definition: NumericCast.hpp:33
+
#define CHECK_LOCATION()
Definition: Exceptions.hpp:192
+ +
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)
+ +
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1