ml.tasks.datasets.video_file
Defines a dataset which iterates through frames in a video file.
- class ml.tasks.datasets.video_file.VideoFileDataset(file_path: str | Path, reader: Literal['ffmpeg', 'av', 'opencv'] = 'ffmpeg', transform: None | Callable[[Tensor], Tensor] = None)[source]
Bases:
IterableDataset
[Tensor
]Defines a dataset which iterates through frames in a video file.
- Parameters:
file_path – The path to the video file to iterate through
reader – The video reader to use
transform – An optional transform to apply to each frame
- video_props: VideoProps
- video_stream: Iterator[ndarray | Tensor]