Skip to content

Commit cb79fbc

Browse files
author
Bruno Korbar
committed
add testing barebones
1 parent 0e7dcc9 commit cb79fbc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/test_prototype_videoutils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
import pytest
55
import torch
66
from torchvision.io import _HAS_VIDEO_DECODER, _HAS_VIDEO_OPT, VideoReader
7-
7+
from torchvision.prototype.features import EncodedData
8+
from torchvision.prototype.utils._internal import ReadOnlyTensorBuffer
9+
from torchvision.prototype.datasets.utils._video import KeyframeDecoder, RandomFrameDecoder
810
try:
911
import av
1012
except ImportError:
@@ -35,6 +37,9 @@ def test_random_decoder_av(self, video_file):
3537
"""Read a sequence of random frames from a video
3638
Checks that files are valid video frames and no error is thrown during decoding.
3739
"""
40+
video_file = os.path.join(VIDEO_DIR, video_file)
41+
video = ReadOnlyTensorBuffer(EncodedData.from_path(video_file))
42+
print(next(video))
3843
pass
3944

4045
def test_random_decoder_cpu(self, video_file):

0 commit comments

Comments
 (0)