aboutsummaryrefslogtreecommitdiff
path: root/tests/ImagePreprocessor.cpp
diff options
context:
space:
mode:
authorFinnWilliamsArm <Finn.Williams@arm.com>2019-05-22 14:50:55 +0100
committerNarumol Prangnawarat <narumol.prangnawarat@arm.com>2019-05-28 09:59:44 +0100
commita723ec5d2ac35948efb5dfd0c121a1a89cb977b7 (patch)
treee0a101fbb7ba41cd50e30a1e0ce31529404175ed /tests/ImagePreprocessor.cpp
parent7f2c35a82ec11be50b3478bd15207320bbf3bd57 (diff)
downloadarmnn-a723ec5d2ac35948efb5dfd0c121a1a89cb977b7.tar.gz
IVGCVSW-3129 Image pre-processing fix for TFLitev19.05
* 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
Diffstat (limited to 'tests/ImagePreprocessor.cpp')
-rw-r--r--tests/ImagePreprocessor.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/ImagePreprocessor.cpp b/tests/ImagePreprocessor.cpp
index 0ef0fda4f9..74bc943ee8 100644
--- a/tests/ImagePreprocessor.cpp
+++ b/tests/ImagePreprocessor.cpp
@@ -31,7 +31,7 @@ unsigned int ImagePreprocessor<TDataType>::GetLabelAndResizedImageAsFloat(unsign
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 @@ ImagePreprocessor<uint8_t>::GetTestCaseData(unsigned int testCaseId)
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));
}