Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -57,38 +57,103 @@ To perform quick inference with the models, follow these steps from the [GitHub
|
|
| 57 |
# https://github.com/Dao-AILab/flash-attention
|
| 58 |
```
|
| 59 |
|
| 60 |
-
##
|
| 61 |
|
| 62 |
-
|
| 63 |
-
```bash
|
| 64 |
-
cd ./pretrained_models
|
| 65 |
-
bash download_pretrained_models.py
|
| 66 |
-
```
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
bash download_checkpoints.py
|
| 72 |
-
```
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
> - **1.3B_2**: Further trained on v1 with large camera movement data and increased image ratio. Better for dynamic video generation. Best on image benchmark (paper results).
|
| 77 |
-
> - **14B**: Best overall performance among 14B models (paper results).
|
| 78 |
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
-
|
| 82 |
-
Run the following commands to try it out:
|
| 83 |
|
| 84 |
-
|
| 85 |
-
# Step 1: Prepare model input
|
| 86 |
-
cd video-generation
|
| 87 |
-
python infer_preprocess.py
|
| 88 |
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
```
|
| 94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
# https://github.com/Dao-AILab/flash-attention
|
| 58 |
```
|
| 59 |
|
| 60 |
+
## 🎬 Training from scratch
|
| 61 |
|
| 62 |
+
>💡 **Data Collection Required**: We find current open-source datasets are not sufficient for training from scratch. We strongly recommend collecting *at least 3,000 additional high-quality video samples* for better results.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
+
We divide the training process into several steps to help you reproduce our results from scratch (using 1.3B as an example).
|
| 65 |
+
|
| 66 |
+
1. Download Pretrained Models
|
|
|
|
|
|
|
| 67 |
|
| 68 |
+
Download the base model from HuggingFace: [Wan-AI/Wan2.1-T2V-1.3B-Diffusers](https://huggingface.co/Wan-AI/Wan2.1-T2V-1.3B-Diffusers)
|
| 69 |
+
2. Download Training Datasets and Pose Pool
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
```bash
|
| 72 |
+
cd datasets
|
| 73 |
+
bash setup_datasets.sh
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
This will download and prepare:
|
| 77 |
+
- Training datasets (open-source + cartoon): `datasets/opensource_dataset/`
|
| 78 |
+
- Pose pool for face enhancement: `datasets/opensource_pose_pool/`
|
| 79 |
+
|
| 80 |
+
<details>
|
| 81 |
+
<summary>Manual Download Links</summary>
|
| 82 |
+
|
| 83 |
+
- [opensource_dataset](https://huggingface.co/datasets/MochunniaN1/One-to-All-sub/tree/main/opensource_dataset)
|
| 84 |
+
- [opensource_pose_pool](https://huggingface.co/datasets/MochunniaN1/One-to-All-sub/tree/main/opensource_pose_pool)
|
| 85 |
+
|
| 86 |
+
</details>
|
| 87 |
+
3. Training
|
| 88 |
+
|
| 89 |
+
We provide three-stage training scripts:
|
| 90 |
+
* Stage 1: Reference Extractor
|
| 91 |
+
|
| 92 |
+
```bash
|
| 93 |
+
cd video-generation
|
| 94 |
+
bash training_scripts/train1.3b_only_refextractor_2d.sh
|
| 95 |
+
# Convert checkpoint to FP32
|
| 96 |
+
cd outputs_wanx1.3b/train1.3b_only_refextractor_2d/checkpoint-xxx
|
| 97 |
+
mkdir fp32_model_xxx
|
| 98 |
+
python zero_to_fp32.py . fp32_model_xxx --safe_serialization
|
| 99 |
+
# Run inference (update model path in inference_refextractor.py first)
|
| 100 |
+
cd ../../../
|
| 101 |
+
# Edit inference_refextractor.py and change ckpt_path to:
|
| 102 |
+
# ./outputs_wanx1.3b/train1.3b_only_refextractor_2d/checkpoint-xxx/fp32_model_xxx
|
| 103 |
+
python inference_refextractor.py
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
* Stage 2: Pose Control
|
| 107 |
+
```bash
|
| 108 |
+
bash training_scripts/train1.3b_posecontrol_prefix_2d.sh
|
| 109 |
+
```
|
| 110 |
+
* Stage 3: Token Replace for Long video generation
|
| 111 |
+
```bash
|
| 112 |
+
bash training_scripts/train1.3b_posecontrol_prefix_2d_tokenreplace.sh
|
| 113 |
+
```
|
| 114 |
+
> 💡 **Training Notes**:
|
| 115 |
+
> - **Each stage uses different training resolutions** - check the scripts for specific resolution settings
|
| 116 |
+
> - **Fine-tuning from our checkpoints**: If you want to continue training from our pre-trained models, directly use the *Stage 3 script* and modify the checkpoint path
|
| 117 |
+
<br>
|
| 118 |
|
| 119 |
+
## 📊 Reproduce Paper Results
|
|
|
|
| 120 |
|
| 121 |
+
We provide scripts to reproduce the quantitative results reported in our paper.
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
+
1. Download Benchmark
|
| 124 |
+
```bash
|
| 125 |
+
cd benchmark
|
| 126 |
+
bash setup_datasets.sh
|
| 127 |
+
```
|
| 128 |
+
2. Prepare Model Input
|
| 129 |
+
```bash
|
| 130 |
+
cd ../video-generation
|
| 131 |
+
python reproduce/infer_preprocess.py
|
| 132 |
+
```
|
| 133 |
+
3. Run Inference
|
| 134 |
+
We provide inference scripts for different model sizes and datasets:
|
| 135 |
+
```bash
|
| 136 |
+
# TikTok dataset
|
| 137 |
+
python reproduce/inference_tiktok1.3b.py # 1.3B model
|
| 138 |
+
python reproduce/inference_tiktok14b.py # 14B model
|
| 139 |
+
|
| 140 |
+
# Cartoon dataset
|
| 141 |
+
python reproduce/inference_cartoon1.3b.py # 1.3B model
|
| 142 |
+
python reproduce/inference_cartoon14b.py # 14B model
|
| 143 |
+
4. Prepare gt/pred pairs for Judge
|
| 144 |
+
```bash
|
| 145 |
+
cd ../benchmark
|
| 146 |
+
# TikTok dataset
|
| 147 |
+
python prepare_eval_frames_tiktok.py
|
| 148 |
+
# Cartoon dataset
|
| 149 |
+
python prepare_eval_frames_cartoon.py
|
| 150 |
+
```
|
| 151 |
+
|
| 152 |
+
5. Run judge
|
| 153 |
+
```bash
|
| 154 |
+
# prepare DisCo environment and lpips fvd ckpt for judge
|
| 155 |
+
cd DisCo
|
| 156 |
+
# TikTok dataset
|
| 157 |
+
bash eval_tiktok.sh
|
| 158 |
+
python summary.py
|
| 159 |
+
```
|