#include <ImagePreprocessor.hpp>
|
| 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< TTestCaseData > | GetTestCaseData (unsigned int testCaseId) |
|
template<> |
std::unique_ptr< ImagePreprocessor< float >::TTestCaseData > | GetTestCaseData (unsigned int testCaseId) |
|
template<> |
std::unique_ptr< ImagePreprocessor< uint8_t >::TTestCaseData > | GetTestCaseData (unsigned int testCaseId) |
|
template<typename TDataType>
class ImagePreprocessor< TDataType >
Definition at line 20 of file ImagePreprocessor.hpp.
◆ DataType
◆ TTestCaseData
◆ DataFormat
◆ 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 |
◆ GetTestCaseData() [1/3]
std::unique_ptr<TTestCaseData> GetTestCaseData |
( |
unsigned int |
testCaseId | ) |
|
◆ GetTestCaseData() [2/3]
Definition at line 59 of file ImagePreprocessor.cpp.
61 std::vector<float> resized;
62 auto label = GetLabelAndResizedImageAsFloat(testCaseId, resized);
63 return std::make_unique<TTestCaseData>(label, std::move(resized));
◆ GetTestCaseData() [3/3]
Definition at line 68 of file ImagePreprocessor.cpp.
70 std::vector<float> resized;
71 auto label = GetLabelAndResizedImageAsFloat(testCaseId, resized);
73 size_t resizedSize = resized.size();
74 std::vector<uint8_t> quantized(resized.size());
76 for (
size_t i=0; i<resizedSize; ++i)
78 quantized[i] =
static_cast<uint8_t
>(resized[i]);
81 return std::make_unique<TTestCaseData>(label, std::move(quantized));
The documentation for this class was generated from the following files: