Skip to content

Commit ab4cf29

Browse files
authored
Relax tolerances for FFmpeg v4.1 and earlier (#1045)
1 parent e170212 commit ab4cf29

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/test_transform_ops.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
assert_frames_equal,
2929
assert_tensor_close_on_at_least,
3030
AV1_VIDEO,
31+
get_ffmpeg_major_version,
32+
get_ffmpeg_minor_version,
3133
H265_VIDEO,
3234
NASA_VIDEO,
3335
needs_cuda,
@@ -254,7 +256,13 @@ def test_resize_ffmpeg(self):
254256

255257
assert frame_resize.shape == expected_shape
256258
assert frame_ref.shape == expected_shape
257-
assert_frames_equal(frame_resize, frame_ref)
259+
260+
if get_ffmpeg_major_version() <= 4 and get_ffmpeg_minor_version() <= 1:
261+
# FFmpeg version 4.1 and before appear to have a different
262+
# resize implementation.
263+
torch.testing.assert_close(frame_resize, frame_ref, rtol=0, atol=2)
264+
else:
265+
assert_frames_equal(frame_resize, frame_ref)
258266

259267
def test_resize_transform_fails(self):
260268
decoder = create_from_file(str(NASA_VIDEO.path))

0 commit comments

Comments
 (0)