Skip to content

Commit 6325180

Browse files
authored
Remove video download and instead move it to repo (#3116)
Makes it appease fbcode internal tests
1 parent 2d80e99 commit 6325180

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed
Binary file not shown.

test/test_io.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import sys
44
import tempfile
55
import torch
6-
import torchvision.datasets.utils as utils
76
import torchvision.io as io
87
from torchvision import get_video_backend
98
import unittest
@@ -148,20 +147,12 @@ def test_read_partial_video_bframes(self):
148147
self.assertTrue((data[5:8].float() - lv.float()).abs().max() < self.TOLERANCE)
149148

150149
def test_read_packed_b_frames_divx_file(self):
151-
with get_tmp_dir() as temp_dir:
152-
name = "hmdb51_Turnk_r_Pippi_Michel_cartwheel_f_cm_np2_le_med_6.avi"
153-
f_name = os.path.join(temp_dir, name)
154-
url = "https://download.pytorch.org/vision_tests/io/" + name
155-
try:
156-
utils.download_url(url, temp_dir)
157-
pts, fps = io.read_video_timestamps(f_name)
158-
159-
self.assertEqual(pts, sorted(pts))
160-
self.assertEqual(fps, 30)
161-
except URLError:
162-
msg = "could not download test file '{}'".format(url)
163-
warnings.warn(msg, RuntimeWarning)
164-
raise unittest.SkipTest(msg)
150+
name = "hmdb51_Turnk_r_Pippi_Michel_cartwheel_f_cm_np2_le_med_6.avi"
151+
f_name = os.path.join(VIDEO_DIR, name)
152+
pts, fps = io.read_video_timestamps(f_name)
153+
154+
self.assertEqual(pts, sorted(pts))
155+
self.assertEqual(fps, 30)
165156

166157
def test_read_timestamps_from_packet(self):
167158
with temp_video(10, 300, 300, 5, video_codec='mpeg4') as (f_name, data):

0 commit comments

Comments
 (0)