This folder contains dataset-specific scripts that convert raw datasets to MotionCrafter training format:
- video clips:
*_rgb.mp4 - annotations:
*_data.hdf5 - index file:
meta_infos.txt
Use one command to run a dataset-specific preprocess script:
python run_preprocess.py \
--dataset spring \
--data-dir /path/to/raw/Spring \
--output-dir /path/to/unnormed/Spring_video \
--split train \
--clip-length 150For scripts using multi-splits:
python run_preprocess.py \
--dataset gta_sfm \
--data-dir /path/to/raw/GTA-SfM \
--output-dir /path/to/unnormed/GTA-SfM_video \
--splits train,testAll gen_*.py scripts now support the same environment variables:
MOTIONCRAFTER_DATA_DIR: raw dataset root directoryMOTIONCRAFTER_OUTPUT_DIR: output directory for converted videos/hdf5MOTIONCRAFTER_CLIP_LENGTH: frames per clip
Optional variables used by some scripts:
MOTIONCRAFTER_SPLITS: comma-separated split list (e.g.train,test)MOTIONCRAFTER_SPLIT: single split nameMOTIONCRAFTER_PROCESS_SCENE_FLOW:true/false(Point Odyssey)
cd datasets/preprocess
MOTIONCRAFTER_DATA_DIR=/path/to/raw/Spring \
MOTIONCRAFTER_OUTPUT_DIR=/path/to/unnormed/Spring_video \
MOTIONCRAFTER_SPLIT=train \
MOTIONCRAFTER_CLIP_LENGTH=150 \
python gen_spring_video.pynormalize_video_dataset.py supports CLI arguments:
python normalize_video_dataset.py \
--data-dirs /path/to/unnormed/Spring_video /path/to/unnormed/GTA-SfM_video \
--output-root /path/to/tmp_datasets \
--resolution 320 640 \
--num-workers 8 \
--skip-existingIf --output-root and --output-dirs are not provided, output defaults to:
- replace
unnormed_datasetswithtmp_datasetsindata_dir, or data_dir/normalizedwhen replacement is not possible.
preprocess_meta_file.py generates latent meta_infos.txt from source meta files:
python preprocess_meta_file.py \
--data-dirs /path/to/data_normed_1/Spring_video /path/to/data_normed_1/GTA-SfM_video \
--latent-dirs /path/to/latent/Spring /path/to/latent/GTA-SfM- Most scripts assume CUDA is available for point map / flow computation.
- Keep clip length consistent with your training setup.
- Some datasets require dataset-specific directory structures exactly as expected by each script.
- Common helper functions for env parsing and
meta_infos.txtwriting are inpreprocess_common.py.
- Dynamic Replica: requires
pytorch3d. - Virtual KITTI 2: requires
pandas. - Scripts reading EXR files (e.g. IRS/Matrix City): require
OpenEXRruntime support.
If pip install -r requirements.txt cannot install pytorch3d in your environment,
install it separately by following the official PyTorch3D installation guide that matches
your PyTorch and CUDA versions.