Skip to content

Commit d29d95b

Browse files
committed
reinstante antialias tests
1 parent a1f5ea4 commit d29d95b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/test_transforms_v2.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,7 @@ def test__transform(self, inpt):
13311331
def test_antialias_warning():
13321332
pil_img = PIL.Image.new("RGB", size=(10, 10), color=127)
13331333
tensor_img = torch.randint(0, 256, size=(3, 10, 10), dtype=torch.uint8)
1334+
tensor_video = torch.randint(0, 256, size=(2, 3, 10, 10), dtype=torch.uint8)
13341335

13351336
match = "The default value of the antialias parameter"
13361337
with pytest.warns(UserWarning, match=match):
@@ -1342,6 +1343,14 @@ def test_antialias_warning():
13421343
with pytest.warns(UserWarning, match=match):
13431344
transforms.RandomResize(10, 20)(tensor_img)
13441345

1346+
with pytest.warns(UserWarning, match=match):
1347+
F.resized_crop(datapoints.Image(tensor_img), 0, 0, 10, 10, (20, 20))
1348+
1349+
with pytest.warns(UserWarning, match=match):
1350+
F.resize(datapoints.Video(tensor_video), (20, 20))
1351+
with pytest.warns(UserWarning, match=match):
1352+
F.resized_crop(datapoints.Video(tensor_video), 0, 0, 10, 10, (20, 20))
1353+
13451354
with warnings.catch_warnings():
13461355
warnings.simplefilter("error")
13471356
transforms.RandomResizedCrop((20, 20))(pil_img)
@@ -1354,6 +1363,9 @@ def test_antialias_warning():
13541363
transforms.RandomShortestSize((20, 20), antialias=True)(tensor_img)
13551364
transforms.RandomResize(10, 20, antialias=True)(tensor_img)
13561365

1366+
F.resized_crop(datapoints.Image(tensor_img), 0, 0, 10, 10, (20, 20), antialias=True)
1367+
F.resized_crop(datapoints.Video(tensor_video), 0, 0, 10, 10, (20, 20), antialias=True)
1368+
13571369

13581370
@pytest.mark.parametrize("image_type", (PIL.Image, torch.Tensor, datapoints.Image))
13591371
@pytest.mark.parametrize("label_type", (torch.Tensor, int))

0 commit comments

Comments
 (0)