Data Utils#
- class cdfvd.utils.data_utils.VideoData[source]#
Class to create dataloaders for video datasets
- Parameters:
data_path – Path to the folder with video frames or videos.
image_folder – If True, the data is stored as images in folders.
resolution – Resolution of the returned videos.
sequence_length – Length of extracted video sequences.
sample_every_n_frames – Sample every n frames from the video.
batch_size – Batch size.
num_workers – Number of workers for the dataloader.
shuffle – If True, shuffle the data.
- class cdfvd.utils.data_utils.VideoDataset[source]#
Generic dataset for videos files stored in folders. Videos of the same class are expected to be stored in a single folder. Multiple folders can exist in the provided directory. The class depends on
torchvision.datasets.video_utils.VideoClips
to load the videos. Returns BCTHW videos in the range [0, 1].- Parameters:
data_folder – Path to the folder with corresponding videos stored.
sequence_length – Length of extracted video sequences.
resolution – Resolution of the returned videos.
sample_every_n_frames – Sample every n frames from the video.
- class cdfvd.utils.data_utils.FrameDataset[source]#
- Generic dataset for videos stored as images. The loading will iterates over all the folders and subfolders
in the provided directory. Each leaf folder is assumed to contain frames from a single video.
- Parameters:
data_folder – path to the folder with video frames. The folder should contain folders with frames from each video.
sequence_length – length of extracted video sequences
resolution – resolution of the returned videos
sample_every_n_frames – sample every n frames from the video