Download src/psi/config/data_seed_video.py from Tinghong-Ye22/code-Psi0-yth-v21: direct link, hf CLI and curl.
- Browser
- Download file 1.95 kB
-
https://huggingface.co/Tinghong-Ye22/code-Psi0-yth-v21/resolve/main/src/psi/config/data_seed_video.py
- Command line
-
hf download hf://Tinghong-Ye22/code-Psi0-yth-v21/src/psi/config/data_seed_video.py
-
curl -L -o data_seed_video.py https://huggingface.co/Tinghong-Ye22/code-Psi0-yth-v21/resolve/main/src/psi/config/data_seed_video.py
1.95 kB
| from __future__ import annotations | |
| from typing import Any | |
| from psi.config.config import DataConfig | |
| class SeedVideoDataConfig(DataConfig): | |
| root_dir: str | |
| video_dir: str | |
| val_ratio: float = 0.1 | |
| split_seed: int = 42 | |
| chunk_size: int = 30 | |
| sample_stride: int = 1 | |
| use_delta_actions: bool = True | |
| motion_fps: int = 50 | |
| video_sample_fps: float = 1.0 | |
| video_size_pixels: int = 50176 | |
| video_cache_size: int = 32 | |
| video_embed_dir: str = "" | |
| use_video_instruction: bool = False | |
| def __call__(self, split: str = "train", transform_kwargs={}, **kwargs) -> Any: | |
| from psi.data.dataset import Dataset as MapStyleDataset | |
| from psi.data.seed.seed_video_motion_dataset import SeedVideoMotionDataset | |
| repack = self.transform.repack | |
| action_chunk_size = int(getattr(repack, "action_chunk_size", self.chunk_size)) | |
| use_delta_actions = bool(getattr(repack, "use_delta_actions", self.use_delta_actions)) | |
| num_past_frames = int(getattr(repack, "num_past_frames", 0)) | |
| self.chunk_size = action_chunk_size | |
| self.use_delta_actions = use_delta_actions | |
| dataset = SeedVideoMotionDataset( | |
| root_dir=self.root_dir, | |
| video_dir=self.video_dir, | |
| split=split, | |
| val_ratio=self.val_ratio, | |
| split_seed=self.split_seed, | |
| action_chunk_size=action_chunk_size, | |
| sample_stride=self.sample_stride, | |
| use_delta_actions=use_delta_actions, | |
| num_past_frames=num_past_frames, | |
| motion_fps=self.motion_fps, | |
| video_sample_fps=self.video_sample_fps, | |
| video_size_pixels=self.video_size_pixels, | |
| video_cache_size=self.video_cache_size, | |
| video_embed_dir=self.video_embed_dir, | |
| use_video_instruction=self.use_video_instruction, | |
| ) | |
| return MapStyleDataset(self, dataset, transform_kwargs=transform_kwargs, **kwargs) | |