Unverified Commit 14553fb9 authored by Liron Ilouz's avatar Liron Ilouz Committed by GitHub
Browse files

proper comparison of input and outpus size before resizing (#7519)


Co-authored-by: default avatarLiron <liron@tapwithus.com>
Co-authored-by: default avatarPhilip Meier <github.pmeier@posteo.de>
parent 683baf8e
......@@ -463,6 +463,16 @@ def test_resize_size_equals_small_edge_size(height, width):
assert max(result.size) == max_size
def test_resize_equal_input_output_sizes():
# Regression test for https://github.com/pytorch/vision/issues/7518
height, width = 28, 27
img = Image.new("RGB", size=(width, height))
t = transforms.Resize((height, width), antialias=True)
result = t(img)
assert result is img
class TestPad:
@pytest.mark.parametrize("fill", [85, 85.0])
def test_pad(self, fill):
......
......@@ -478,7 +478,7 @@ def resize(
size = [size]
output_size = _compute_resized_output_size((image_height, image_width), size, max_size)
if (image_height, image_width) == output_size:
if [image_height, image_width] == output_size:
return img
antialias = _check_antialias(img, antialias, interpolation)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment