Skip to content

Commit bd1a3dd

Browse files
committed
reverting warning commit
1 parent 5da68e1 commit bd1a3dd

File tree

1 file changed

+50
-19
lines changed

1 file changed

+50
-19
lines changed

torchvision/io/_video_opt.py

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import importlib
32
import math
43
import os
@@ -17,7 +16,7 @@
1716

1817
loader_details = (
1918
importlib.machinery.ExtensionFileLoader,
20-
importlib.machinery.EXTENSION_SUFFIXES
19+
importlib.machinery.EXTENSION_SUFFIXES,
2120
)
2221

2322
extfinder = importlib.machinery.FileFinder(lib_dir, loader_details)
@@ -26,9 +25,7 @@
2625
torch.ops.load_library(ext_specs.origin)
2726
_HAS_VIDEO_OPT = True
2827
except (ImportError, OSError):
29-
warnings.warn("Could not import video_reader bakcend."
30-
+ " Make sure ffmpeg is installed properly"
31-
+ " and rebuild torchvision.")
28+
pass
3229

3330

3431
default_timebase = Fraction(0, 1)
@@ -243,10 +240,18 @@ def _read_video_from_file(
243240
audio_timebase.numerator,
244241
audio_timebase.denominator,
245242
)
246-
vframes, _vframe_pts, vtimebase, vfps, vduration, \
247-
aframes, aframe_pts, atimebase, asample_rate, aduration = (
248-
result
249-
)
243+
(
244+
vframes,
245+
_vframe_pts,
246+
vtimebase,
247+
vfps,
248+
vduration,
249+
aframes,
250+
aframe_pts,
251+
atimebase,
252+
asample_rate,
253+
aduration,
254+
) = result
250255
info = _fill_info(vtimebase, vfps, vduration, atimebase, asample_rate, aduration)
251256
if aframes.numel() > 0:
252257
# when audio stream is found
@@ -281,8 +286,18 @@ def _read_video_timestamps_from_file(filename):
281286
0, # audio_timebase_num
282287
1, # audio_timebase_den
283288
)
284-
_vframes, vframe_pts, vtimebase, vfps, vduration, \
285-
_aframes, aframe_pts, atimebase, asample_rate, aduration = (result)
289+
(
290+
_vframes,
291+
vframe_pts,
292+
vtimebase,
293+
vfps,
294+
vduration,
295+
_aframes,
296+
aframe_pts,
297+
atimebase,
298+
asample_rate,
299+
aduration,
300+
) = result
286301
info = _fill_info(vtimebase, vfps, vduration, atimebase, asample_rate, aduration)
287302

288303
vframe_pts = vframe_pts.numpy().tolist()
@@ -406,10 +421,18 @@ def _read_video_from_memory(
406421
audio_timebase_denominator,
407422
)
408423

409-
vframes, _vframe_pts, vtimebase, vfps, vduration, \
410-
aframes, aframe_pts, atimebase, asample_rate, aduration = (
411-
result
412-
)
424+
(
425+
vframes,
426+
_vframe_pts,
427+
vtimebase,
428+
vfps,
429+
vduration,
430+
aframes,
431+
aframe_pts,
432+
atimebase,
433+
asample_rate,
434+
aduration,
435+
) = result
413436

414437
if aframes.numel() > 0:
415438
# when audio stream is found
@@ -447,10 +470,18 @@ def _read_video_timestamps_from_memory(video_data):
447470
0, # audio_timebase_num
448471
1, # audio_timebase_den
449472
)
450-
_vframes, vframe_pts, vtimebase, vfps, vduration, \
451-
_aframes, aframe_pts, atimebase, asample_rate, aduration = (
452-
result
453-
)
473+
(
474+
_vframes,
475+
vframe_pts,
476+
vtimebase,
477+
vfps,
478+
vduration,
479+
_aframes,
480+
aframe_pts,
481+
atimebase,
482+
asample_rate,
483+
aduration,
484+
) = result
454485
info = _fill_info(vtimebase, vfps, vduration, atimebase, asample_rate, aduration)
455486

456487
vframe_pts = vframe_pts.numpy().tolist()

0 commit comments

Comments
 (0)