|
3 | 3 | import sys
|
4 | 4 | import tempfile
|
5 | 5 | import torch
|
6 |
| -import torchvision.datasets.utils as utils |
7 | 6 | import torchvision.io as io
|
8 | 7 | from torchvision import get_video_backend
|
9 | 8 | import unittest
|
@@ -148,20 +147,12 @@ def test_read_partial_video_bframes(self):
|
148 | 147 | self.assertTrue((data[5:8].float() - lv.float()).abs().max() < self.TOLERANCE)
|
149 | 148 |
|
150 | 149 | 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) |
165 | 156 |
|
166 | 157 | def test_read_timestamps_from_packet(self):
|
167 | 158 | with temp_video(10, 300, 300, 5, video_codec='mpeg4') as (f_name, data):
|
|
0 commit comments