aboutsummaryrefslogtreecommitdiff
path: root/tests/ImagePreprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ImagePreprocessor.cpp')
-rw-r--r--tests/ImagePreprocessor.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/ImagePreprocessor.cpp b/tests/ImagePreprocessor.cpp
index 1f29cffe65..8ceedd2d04 100644
--- a/tests/ImagePreprocessor.cpp
+++ b/tests/ImagePreprocessor.cpp
@@ -33,10 +33,16 @@ unsigned int ImagePreprocessor<TDataType>::GetLabelAndResizedImageAsFloat(unsign
InferenceTestImage::ResizingMethods::BilinearAndNormalized,
m_Mean, m_Stddev);
+ // duplicate data across the batch
+ for (unsigned int i = 1; i < m_BatchSize; i++)
+ {
+ result.insert( result.end(), result.begin(), result.begin() + GetNumImageElements() );
+ }
+
if (m_DataFormat == DataFormat::NCHW)
{
const armnn::PermutationVector NHWCToArmNN = { 0, 2, 3, 1 };
- armnn::TensorShape dstShape({1, 3, m_Height, m_Width});
+ armnn::TensorShape dstShape({m_BatchSize, 3, m_Height, m_Width});
std::vector<float> tempImage(result.size());
armnnUtils::Permute<float>(dstShape, NHWCToArmNN, result.data(), tempImage.data());
result.swap(tempImage);