IVGCVSW-3129 Image pre-processing fix for TFLite
* Resized images for quantized models are now statically cast to uint8
instead of quantized
* Removed optional quantization parameters from ImagePreprocessor
constructor
* Changed mean and scale for TFLite models
Signed-off-by: FinnWilliamsArm <Finn.Williams@arm.com>
Change-Id: Id5ffdf77f3614d10c417e769bd8ffc4a4c07308b
diff --git a/tests/ImagePreprocessor.cpp b/tests/ImagePreprocessor.cpp
index 0ef0fda..74bc943 100644
--- a/tests/ImagePreprocessor.cpp
+++ b/tests/ImagePreprocessor.cpp
@@ -31,7 +31,7 @@
result = image.Resize(m_Width, m_Height, CHECK_LOCATION(),
InferenceTestImage::ResizingMethods::BilinearAndNormalized,
- m_Mean, m_Stddev);
+ m_Mean, m_Stddev, m_Scale);
// duplicate data across the batch
for (unsigned int i = 1; i < m_BatchSize; i++)
@@ -72,9 +72,8 @@
for (size_t i=0; i<resizedSize; ++i)
{
- quantized[i] = armnn::Quantize<uint8_t>(resized[i],
- m_Scale,
- m_Offset);
+ quantized[i] = static_cast<uint8_t>(resized[i]);
}
+
return std::make_unique<TTestCaseData>(label, std::move(quantized));
}