aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Conroy <james.conroy@arm.com>2018-11-26 09:48:30 +0000
committerMatteo Martincigh <matteo.martincigh@arm.com>2018-11-26 17:37:37 +0000
commitcd45d0b9099ae504f4798500cc712ccf957bc2a1 (patch)
tree2f7eb8b8b539db648d7b46d3ffcc6ee81a262fc8
parent418f011efa6edf5db096c8b8b3b18b2805b2dbde (diff)
downloadarmnn-cd45d0b9099ae504f4798500cc712ccf957bc2a1.tar.gz
IVGCVSW-2199 Call Resize only if H and/or W changes
* Wrap Resize function call with conditional checking if height and/or width need to be changed. Change-Id: Ic33c3ed29cc985c147d29db8e9dd237ab9c741d1 (cherry picked from commit e02d60154d8230f555c832c1cce1865b54dc6589)
-rw-r--r--tests/YoloDatabase.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/YoloDatabase.cpp b/tests/YoloDatabase.cpp
index 0f5dee026c..472fc8083d 100644
--- a/tests/YoloDatabase.cpp
+++ b/tests/YoloDatabase.cpp
@@ -83,7 +83,10 @@ std::unique_ptr<YoloDatabase::TTestCaseData> YoloDatabase::GetTestCaseData(unsig
try
{
InferenceTestImage image(imagePath.c_str());
- image.Resize(YoloImageWidth, YoloImageHeight, CHECK_LOCATION());
+ if (YoloImageWidth != image.GetWidth() || YoloImageHeight != image.GetHeight())
+ {
+ image.Resize(YoloImageWidth, YoloImageHeight, CHECK_LOCATION());
+ }
imageData = GetImageDataInArmNnLayoutAsNormalizedFloats(ImageChannelLayout::Rgb, image);
}
catch (const InferenceTestImageException& e)