MochunniaN1 commited on
Commit
f942e51
·
verified ·
1 Parent(s): 91d34b4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +93 -28
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
- ### ⬇️ Download Models
61
 
62
- - Download pretrained models
63
- ```bash
64
- cd ./pretrained_models
65
- bash download_pretrained_models.py
66
- ```
67
 
68
- - Download checkpoints
69
- ```bash
70
- cd ./checkpoints
71
- bash download_checkpoints.py
72
- ```
73
 
74
- > 💡 **Tip**: Edit the script and uncomment the specific models you want to download.
75
- > - **1.3B_1**: Best performance on video benchmark among 1.3B models (paper results).
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
- ### 🚀 Run Inference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
- We provide several examples in the [`examples`](https://github.com/ssj9596/One-to-All-Animation/tree/main/examples) folder.
82
- Run the following commands to try it out:
83
 
84
- ```bash
85
- # Step 1: Prepare model input
86
- cd video-generation
87
- python infer_preprocess.py
88
 
89
- # Step 2: Run inference with your preferred model
90
- python inference_1.3b.py # For 1.3B model
91
- # or
92
- python inference_14b.py # For 14B model
93
- ```
94
- You can enter the script to modify the input path.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ```