video
¶
Functions¶
fastvideo.eval.io.video.extract_frames
¶
extract_frames(video: Tensor, n_frames: int | None = None) -> Tensor
Uniformly sample n_frames from a (T, C, H, W) video tensor.
Source code in fastvideo/eval/io/video.py
fastvideo.eval.io.video.load_video
¶
Load a video as a (T, C, H, W) float32 tensor in [0, 1].
Supported source types:
- str / Path – path to
.mp4/.avi/.giffile, or a directory of frame images (sorted alphabetically). - torch.Tensor – returned as-is after shape validation.
- list[PIL.Image] – stacked into a tensor.