dataset ¶
Classes¶
fastvideo.dataset.LTX2PrecomputedDataset ¶
Bases: Dataset
Dataset for LTX-2 precomputed latents and conditions.
Expected directory structure (data_root): .precomputed/ latents/.pt conditions/.pt audio_latents/*.pt (optional)
Source code in fastvideo/dataset/ltx2_precomputed_dataset.py
fastvideo.dataset.TextDataset ¶
Bases: IterableDataset, Stateful
Text-only dataset for processing prompts from a simple text file.
Assumes that data_merge_path is a text file with one prompt per line: A cat playing with a ball A dog running in the park A person cooking dinner ...
This dataset processes text data through text encoding stages only.
Source code in fastvideo/dataset/preprocessing_datasets.py
Methods:¶
fastvideo.dataset.TextDataset.__iter__ ¶
Iterator for the dataset.
Source code in fastvideo/dataset/preprocessing_datasets.py
fastvideo.dataset.TextDataset.load_state_dict ¶
fastvideo.dataset.TextDataset.state_dict ¶
fastvideo.dataset.ValidationDataset ¶
ValidationDataset(filename: str)
Bases: IterableDataset
Source code in fastvideo/dataset/validation_dataset.py
fastvideo.dataset.VideoCaptionMergedDataset ¶
VideoCaptionMergedDataset(data_merge_path: str, args, transform, temporal_sample, transform_topcrop, start_idx: int = 0, seed: int = 42)
Bases: IterableDataset, Stateful
Merged dataset for video and caption data with stage-based processing. Assumes that data_merge_path is a txt file with the following format:
The folder should contain videos.
The json file should be a list of dictionaries with the following format:
[
{
"path": "1gGQy4nxyUo-Scene-016.mp4",
"resolution": {
"width": 1920,
"height": 1080
},
"size": 2439112,
"fps": 25.0,
"duration": 6.88,
"num_frames": 172,
"cap": [
"A watermelon wearing a helmet is crushed by a hydraulic press, causing it to flatten and burst open."
]
},
...
]
This dataset processes video and image data through a series of stages: - Data validation - Resolution filtering
- Frame sampling - Transformation - Text encoding