From c9f87dd004f7789c6fa9451018493b7bf643b8ae Mon Sep 17 00:00:00 2001 From: AlgorithmicIntelligence <37929597+AlgorithmicIntelligence@users.noreply.github.com> Date: Fri, 3 Sep 2021 16:02:41 +0800 Subject: [PATCH] Update dataset.py fix a bug in resize_with_aspectratio when new_width and new_height are not the same. --- vision/classification_and_detection/python/dataset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vision/classification_and_detection/python/dataset.py b/vision/classification_and_detection/python/dataset.py index dce968a3d..73cc2fb3a 100755 --- a/vision/classification_and_detection/python/dataset.py +++ b/vision/classification_and_detection/python/dataset.py @@ -157,10 +157,10 @@ def resize_with_aspectratio(img, out_height, out_width, scale=87.5, inter_pol=cv new_width = int(100. * out_width / scale) if height > width: w = new_width - h = int(new_height * height / width) + h = int (height * (new_width / width)) else: h = new_height - w = int(new_width * width / height) + w = int(width * (new_height/ height)) img = cv2.resize(img, (w, h), interpolation=inter_pol) return img