Skip to content

Commit b68adcf

Browse files
committed
Make read_video_meta_data_from_memory and read_video_from_memory private (#2077) (#2084)
Summary: Pull Request resolved: #2077 Pull Request resolved: facebookresearch/SlowFast#164 This is a follow-up diff from D18720474 We will be releasing a new version of torchvision soon and the signature of those functions is not ready yet, following my comment in https://our.intern.facebook.com/intern/diff/D18720474/?transaction_id=561239541337402 Reviewed By: stephenyan1231 Differential Revision: D20914571 fbshipit-source-id: 1a7560b8f8e46ab42ef376c50b494a4f73923e94 Co-authored-by: Francisco Massa <[email protected]>
1 parent 1ae7f5c commit b68adcf

File tree

3 files changed

+4
-52
lines changed

3 files changed

+4
-52
lines changed

test/test_video_reader.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,8 +1183,8 @@ def test_probe_video_from_memory(self):
11831183
probe_result = torch.ops.video_reader.probe_video_from_memory(video_tensor)
11841184
self.check_probe_result(probe_result, config)
11851185

1186-
def test_read_video_meta_data_from_memory_script(self):
1187-
scripted_fun = torch.jit.script(io.read_video_meta_data_from_memory)
1186+
def test_probe_video_from_memory_script(self):
1187+
scripted_fun = torch.jit.script(io._probe_video_from_memory)
11881188
self.assertIsNotNone(scripted_fun)
11891189

11901190
for test_video, config in test_videos.items():
@@ -1205,7 +1205,7 @@ def test_read_video_from_memory_scripted(self):
12051205
audio_start_pts, audio_end_pts = 0, -1
12061206
audio_timebase_num, audio_timebase_den = 0, 1
12071207

1208-
scripted_fun = torch.jit.script(io.read_video_from_memory)
1208+
scripted_fun = torch.jit.script(io._read_video_from_memory)
12091209
self.assertIsNotNone(scripted_fun)
12101210

12111211
for test_video, _config in test_videos.items():
@@ -1219,6 +1219,7 @@ def test_read_video_from_memory_scripted(self):
12191219
width,
12201220
height,
12211221
min_dimension,
1222+
max_dimension,
12221223
[video_start_pts, video_end_pts],
12231224
video_timebase_num,
12241225
video_timebase_den,
@@ -1228,7 +1229,6 @@ def test_read_video_from_memory_scripted(self):
12281229
[audio_start_pts, audio_end_pts],
12291230
audio_timebase_num,
12301231
audio_timebase_den,
1231-
max_dimension,
12321232
)
12331233
# FUTURE: check value of video / audio frames
12341234

torchvision/io/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
)
1212
from .video import (
1313
read_video,
14-
read_video_from_memory,
15-
read_video_meta_data_from_memory,
1614
read_video_timestamps,
1715
write_video,
1816
)
@@ -22,8 +20,6 @@
2220
"write_video",
2321
"read_video",
2422
"read_video_timestamps",
25-
"read_video_meta_data_from_memory",
26-
"read_video_from_memory",
2723
"_read_video_from_file",
2824
"_read_video_timestamps_from_file",
2925
"_probe_video_from_file",

torchvision/io/video.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -347,47 +347,3 @@ def read_video_timestamps(filename, pts_unit="pts"):
347347
pts = [x * video_time_base for x in pts]
348348

349349
return pts, video_fps
350-
351-
352-
def read_video_meta_data_from_memory(video_data):
353-
# type: (torch.Tensor) -> VideoMetaData
354-
return _video_opt._probe_video_from_memory(video_data)
355-
356-
357-
def read_video_from_memory(
358-
video_data, # type: torch.Tensor
359-
seek_frame_margin=0.25, # type: float
360-
read_video_stream=1, # type: int
361-
video_width=0, # type: int
362-
video_height=0, # type: int
363-
video_min_dimension=0, # type: int
364-
video_pts_range=(0, -1), # type: List[int]
365-
video_timebase_numerator=0, # type: int
366-
video_timebase_denominator=1, # type: int
367-
read_audio_stream=1, # type: int
368-
audio_samples=0, # type: int
369-
audio_channels=0, # type: int
370-
audio_pts_range=(0, -1), # type: List[int]
371-
audio_timebase_numerator=0, # type: int
372-
audio_timebase_denominator=1, # type: int
373-
video_max_dimension=0, # type: int
374-
):
375-
# type: (...) -> Tuple[torch.Tensor, torch.Tensor]
376-
return _video_opt._read_video_from_memory(
377-
video_data,
378-
seek_frame_margin,
379-
read_video_stream,
380-
video_width,
381-
video_height,
382-
video_min_dimension,
383-
video_max_dimension,
384-
video_pts_range,
385-
video_timebase_numerator,
386-
video_timebase_denominator,
387-
read_audio_stream,
388-
audio_samples,
389-
audio_channels,
390-
audio_pts_range,
391-
audio_timebase_numerator,
392-
audio_timebase_denominator,
393-
)

0 commit comments

Comments
 (0)