Commit 09823951 authored by ekosman's avatar ekosman Committed by Francisco Massa
Browse files

Video clips workers (#1369)

* Expose num_workers in VideoClips

* add documentation for num_workers in VideoClips

* add documentation for num_workers in VideoClips

* add documentation for num_workers in VideoClips
parent 78743740
...@@ -64,13 +64,15 @@ class VideoClips(object): ...@@ -64,13 +64,15 @@ class VideoClips(object):
frame_rate (int, optional): if specified, it will resample the video frame_rate (int, optional): if specified, it will resample the video
so that it has `frame_rate`, and then the clips will be defined so that it has `frame_rate`, and then the clips will be defined
on the resampled video on the resampled video
num_workers (int): how many subprocesses to use for data loading.
0 means that the data will be loaded in the main process. (default: 0)
""" """
def __init__(self, video_paths, clip_length_in_frames=16, frames_between_clips=1, def __init__(self, video_paths, clip_length_in_frames=16, frames_between_clips=1,
frame_rate=None, _precomputed_metadata=None, num_workers=1, frame_rate=None, _precomputed_metadata=None, num_workers=0, _backend="pyav"):
_backend="pyav"):
self.video_paths = video_paths self.video_paths = video_paths
self.num_workers = num_workers self.num_workers = num_workers
self._backend = _backend self._backend = _backend
if _precomputed_metadata is None: if _precomputed_metadata is None:
self._compute_frame_pts() self._compute_frame_pts()
else: else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment