ruizhaocv commited on
Commit
c6622e2
1 Parent(s): 7d421db

Delete README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -364
README.md DELETED
@@ -1,364 +0,0 @@
1
- # MotionDirector
2
-
3
- This is the official repository of [MotionDirector](https://showlab.github.io/MotionDirector).
4
-
5
- **MotionDirector: Motion Customization of Text-to-Video Diffusion Models.**
6
- <br/>
7
- [Rui Zhao](https://ruizhaocv.github.io/),
8
- [Yuchao Gu](https://ycgu.site/),
9
- [Jay Zhangjie Wu](https://zhangjiewu.github.io/),
10
- [David Junhao Zhang](https://junhaozhang98.github.io/),
11
- [Jiawei Liu](https://jia-wei-liu.github.io/),
12
- [Weijia Wu](https://weijiawu.github.io/),
13
- [Jussi Keppo](https://www.jussikeppo.com/),
14
- [Mike Zheng Shou](https://sites.google.com/view/showlab)
15
- <br/>
16
-
17
- [![Project Page](https://img.shields.io/badge/Project-Website-orange)](https://showlab.github.io/MotionDirector)
18
- [![arXiv](https://img.shields.io/badge/arXiv-MotionDirector-b31b1b.svg)](https://arxiv.org/abs/2310.08465)
19
-
20
- <p align="center">
21
- <img src="https://github.com/showlab/MotionDirector/blob/page/assets/teaser.gif" width="1080px"/>
22
- <br>
23
- <em>MotionDirector can customize text-to-video diffusion models to generate videos with desired motions.</em>
24
- </p>
25
-
26
- <table class="center">
27
- <tr>
28
- <td style="text-align:center;" colspan="4"><b>Astronaut's daily life on Mars (Motion concepts learned by MotionDirector)</b></td>
29
- </tr>
30
- <tr>
31
- <td style="text-align:center;"><b>Lifting Weights</b></td>
32
- <td style="text-align:center;"><b>Playing Golf</b></td>
33
- <td style="text-align:center;"><b>Riding Horse</b></td>
34
- <td style="text-align:center;"><b>Riding Bicycle</b></td>
35
- </tr>
36
- <tr>
37
- <td><img src=assets/astronaut_mars/An_astronaut_is_lifting_weights_on_Mars_4K_high_quailty_highly_detailed_4008521.gif></td>
38
- <td><img src=assets/astronaut_mars/Astronaut_playing_golf_on_Mars_659514.gif></td>
39
- <td><img src=assets/astronaut_mars/An_astronaut_is_riding_a_horse_on_Mars_4K_high_quailty_highly_detailed_1913261.gif></td>
40
- <td><img src=assets/astronaut_mars/An_astronaut_is_riding_a_bicycle_past_the_pyramids_Mars_4K_high_quailty_highly_detailed_5532778.gif></td>
41
- </tr>
42
- <tr>
43
- <td width=25% style="text-align:center;">"An astronaut is lifting weights on Mars, 4K, high quailty, highly detailed.” </br> seed: 4008521</td>
44
- <td width=25% style="text-align:center;">"Astronaut playing golf on Mars” </br> seed: 659514</td>
45
- <td width=25% style="text-align:center;">"An astronaut is riding a horse on Mars, 4K, high quailty, highly detailed." </br> seed: 1913261</td>
46
- <td width=25% style="text-align:center;">"An astronaut is riding a bicycle past the pyramids Mars, 4K, high quailty, highly detailed." </br> seed: 5532778</td>
47
- <tr>
48
- </table>
49
-
50
- ## News
51
- - [2023.12.06] [MotionDirector for Sports](#MotionDirector_for_Sports) released! Lifting weights, riding horse, palying golf, etc.
52
- - [2023.12.05] [Colab demo](https://github.com/camenduru/MotionDirector-colab) is available. Thanks to [Camenduru](https://twitter.com/camenduru).
53
- - [2023.12.04] [MotionDirector for Cinematic Shots](#MotionDirector_for_Cinematic_Shots) released. Now, you can make AI films with professional cinematic shots!
54
- - [2023.12.02] Code and model weights released!
55
-
56
- ## ToDo
57
- - [ ] Gradio Demo
58
- - [ ] More trained weights of MotionDirector
59
-
60
- ## Setup
61
- ### Requirements
62
-
63
- ```shell
64
- # create virtual environment
65
- conda create -n motiondirector python=3.8
66
- conda activate motiondirector
67
- # install packages
68
- pip install -r requirements.txt
69
- ```
70
-
71
- ### Weights of Foundation Models
72
- ```shell
73
- git lfs install
74
- ## You can choose the ModelScopeT2V or ZeroScope, etc., as the foundation model.
75
- ## ZeroScope
76
- git clone https://huggingface.co/cerspense/zeroscope_v2_576w ./models/zeroscope_v2_576w/
77
- ## ModelScopeT2V
78
- git clone https://huggingface.co/damo-vilab/text-to-video-ms-1.7b ./models/model_scope/
79
- ```
80
- ### Weights of trained MotionDirector <a name="download_weights"></a>
81
- ```shell
82
- # Make sure you have git-lfs installed (https://git-lfs.com)
83
- git lfs install
84
- git clone https://huggingface.co/ruizhaocv/MotionDirector_weights ./outputs
85
- ```
86
-
87
- ## Usage
88
- ### Training
89
-
90
- #### Train MotionDirector on multiple videos:
91
- ```bash
92
- python MotionDirector_train.py --config ./configs/config_multi_videos.yaml
93
- ```
94
- #### Train MotionDirector on a single video:
95
- ```bash
96
- python MotionDirector_train.py --config ./configs/config_single_video.yaml
97
- ```
98
-
99
- Note:
100
- - Before running the above command,
101
- make sure you replace the path to foundational model weights and training data with your own in the config files `config_multi_videos.yaml` or `config_single_video.yaml`.
102
- - Generally, training on multiple 16-frame videos usually takes `300~500` steps, about `9~16` minutes using one A5000 GPU. Training on a single video takes `50~150` steps, about `1.5~4.5` minutes using one A5000 GPU. The required VRAM for training is around `14GB`.
103
- - Reduce `n_sample_frames` if your GPU memory is limited.
104
- - Reduce the learning rate and increase the training steps for better performance.
105
-
106
-
107
- ### Inference
108
- ```bash
109
- python MotionDirector_inference.py --model /path/to/the/foundation/model --prompt "Your prompt" --checkpoint_folder /path/to/the/trained/MotionDirector --checkpoint_index 300 --noise_prior 0.
110
- ```
111
- Note:
112
- - Replace `/path/to/the/foundation/model` with your own path to the foundation model, like ZeroScope.
113
- - The value of `checkpoint_index` means the checkpoint saved at which the training step is selected.
114
- - The value of `noise_prior` indicates how much the inversion noise of the reference video affects the generation.
115
- We recommend setting it to `0` for MotionDirector trained on multiple videos to achieve the highest diverse generation, while setting it to `0.1~0.5` for MotionDirector trained on a single video for faster convergence and better alignment with the reference video.
116
-
117
-
118
- ## Inference with pre-trained MotionDirector
119
- All available weights are at official [Huggingface Repo](https://huggingface.co/ruizhaocv/MotionDirector_weights).
120
- Run the [download command](#download_weights), the weights will be downloaded to the folder `outputs`, then run the following inference command to generate videos.
121
-
122
- ### MotionDirector trained on multiple videos:
123
- ```bash
124
- python MotionDirector_inference.py --model /path/to/the/ZeroScope --prompt "A person is riding a bicycle past the Eiffel Tower." --checkpoint_folder ./outputs/train/riding_bicycle/ --checkpoint_index 300 --noise_prior 0. --seed 7192280
125
- ```
126
- Note:
127
- - Replace `/path/to/the/ZeroScope` with your own path to the foundation model, i.e. the ZeroScope.
128
- - Change the `prompt` to generate different videos.
129
- - The `seed` is set to a random value by default. Set it to a specific value will obtain certain results, as provided in the table below.
130
-
131
- Results:
132
-
133
- <table class="center">
134
- <tr>
135
- <td style="text-align:center;"><b>Reference Videos</b></td>
136
- <td style="text-align:center;" colspan="3"><b>Videos Generated by MotionDirector</b></td>
137
- </tr>
138
- <tr>
139
- <td><img src=assets/multi_videos_results/reference_videos.gif></td>
140
- <td><img src=assets/multi_videos_results/A_person_is_riding_a_bicycle_past_the_Eiffel_Tower_7192280.gif></td>
141
- <td><img src=assets/multi_videos_results/A_panda_is_riding_a_bicycle_in_a_garden_2178639.gif></td>
142
- <td><img src=assets/multi_videos_results/An_alien_is_riding_a_bicycle_on_Mars_2390886.gif></td>
143
- </tr>
144
- <tr>
145
- <td width=25% style="text-align:center;color:gray;">"A person is riding a bicycle."</td>
146
- <td width=25% style="text-align:center;">"A person is riding a bicycle past the Eiffel Tower.” </br> seed: 7192280</td>
147
- <td width=25% style="text-align:center;">"A panda is riding a bicycle in a garden." </br> seed: 2178639</td>
148
- <td width=25% style="text-align:center;">"An alien is riding a bicycle on Mars." </br> seed: 2390886</td>
149
- </table>
150
-
151
- ### MotionDirector trained on a single video:
152
- 16 frames:
153
- ```bash
154
- python MotionDirector_inference.py --model /path/to/the/ZeroScope --prompt "A tank is running on the moon." --checkpoint_folder ./outputs/train/car_16/ --checkpoint_index 150 --noise_prior 0.5 --seed 8551187
155
- ```
156
- <table class="center">
157
- <tr>
158
- <td style="text-align:center;"><b>Reference Video</b></td>
159
- <td style="text-align:center;" colspan="3"><b>Videos Generated by MotionDirector</b></td>
160
- </tr>
161
- <tr>
162
- <td><img src=assets/single_video_results/reference_video.gif></td>
163
- <td><img src=assets/single_video_results/A_tank_is_running_on_the_moon_8551187.gif></td>
164
- <td><img src=assets/single_video_results/A_lion_is_running_past_the_pyramids_431554.gif></td>
165
- <td><img src=assets/single_video_results/A_spaceship_is_flying_past_Mars_8808231.gif></td>
166
- </tr>
167
- <tr>
168
- <td width=25% style="text-align:center;color:gray;">"A car is running on the road."</td>
169
- <td width=25% style="text-align:center;">"A tank is running on the moon.” </br> seed: 8551187</td>
170
- <td width=25% style="text-align:center;">"A lion is running past the pyramids." </br> seed: 431554</td>
171
- <td width=25% style="text-align:center;">"A spaceship is flying past Mars." </br> seed: 8808231</td>
172
- </tr>
173
- </table>
174
-
175
- 24 frames:
176
- ```bash
177
- python MotionDirector_inference.py --model /path/to/the/ZeroScope --prompt "A truck is running past the Arc de Triomphe." --checkpoint_folder ./outputs/train/car_24/ --checkpoint_index 150 --noise_prior 0.5 --width 576 --height 320 --num-frames 24 --seed 34543
178
- ```
179
- <table class="center">
180
- <tr>
181
- <td style="text-align:center;"><b>Reference Video</b></td>
182
- <td style="text-align:center;" colspan="3"><b>Videos Generated by MotionDirector</b></td>
183
- </tr>
184
- <tr>
185
- <td><img src=assets/single_video_results/24_frames/reference_video.gif></td>
186
- <td><img src=assets/single_video_results/24_frames/A_truck_is_running_past_the_Arc_de_Triomphe_34543.gif></td>
187
- <td><img src=assets/single_video_results/24_frames/An_elephant_is_running_in_a_forest_2171736.gif></td>
188
- </tr>
189
- <tr>
190
- <td width=25% style="text-align:center;color:gray;">"A car is running on the road."</td>
191
- <td width=25% style="text-align:center;">"A truck is running past the Arc de Triomphe.” </br> seed: 34543</td>
192
- <td width=25% style="text-align:center;">"An elephant is running in a forest." </br> seed: 2171736</td>
193
- </tr>
194
- <tr>
195
- <td><img src=assets/single_video_results/24_frames/reference_video.gif></td>
196
- <td><img src=assets/single_video_results/24_frames/A_person_on_a_camel_is_running_past_the_pyramids_4904126.gif></td>
197
- <td><img src=assets/single_video_results/24_frames/A_spacecraft_is_flying_past_the_Milky_Way_galaxy_3235677.gif></td>
198
- </tr>
199
- <tr>
200
- <td width=25% style="text-align:center;color:gray;">"A car is running on the road."</td>
201
- <td width=25% style="text-align:center;">"A person on a camel is running past the pyramids." </br> seed: 4904126</td>
202
- <td width=25% style="text-align:center;">"A spacecraft is flying past the Milky Way galaxy." </br> seed: 3235677</td>
203
- </tr>
204
- </table>
205
-
206
- ## MotionDirector for Sports <a name="MotionDirector_for_Sports"></a>
207
-
208
- ```bash
209
- python MotionDirector_inference.py --model /path/to/the/ZeroScope --prompt "A panda is lifting weights in a garden." --checkpoint_folder ./outputs/train/lifting_weights/ --checkpoint_index 300 --noise_prior 0. --seed 9365597
210
- ```
211
- <table class="center">
212
- <tr>
213
- <td style="text-align:center;" colspan="4"><b>Videos Generated by MotionDirector</b></td>
214
- </tr>
215
- <tr>
216
- <td style="text-align:center;" colspan="2"><b>Lifting Weights</b></td>
217
- <td style="text-align:center;" colspan="2"><b>Riding Bicycle</b></td>
218
- </tr>
219
- <tr>
220
- <td><img src=assets/sports_results/lifting_weights/A_panda_is_lifting_weights_in_a_garden_1699276.gif></td>
221
- <td><img src=assets/sports_results/lifting_weights/A_police_officer_is_lifting_weights_in_front_of_the_police_station_6804745.gif></td>
222
- <td><img src=assets/multi_videos_results/A_panda_is_riding_a_bicycle_in_a_garden_2178639.gif></td>
223
- <td><img src=assets/multi_videos_results/An_alien_is_riding_a_bicycle_on_Mars_2390886.gif></td>
224
- </tr>
225
- <tr>
226
- <td width=25% style="text-align:center;">"A panda is lifting weights in a garden.” </br> seed: 1699276</td>
227
- <td width=25% style="text-align:center;">"A police officer is lifting weights in front of the police station.” </br> seed: 6804745</td>
228
- <td width=25% style="text-align:center;">"A panda is riding a bicycle in a garden." </br> seed: 2178639</td>
229
- <td width=25% style="text-align:center;">"An alien is riding a bicycle on Mars." </br> seed: 2390886</td>
230
- <tr>
231
- <td style="text-align:center;" colspan="2"><b>Riding Horse</b></td>
232
- <td style="text-align:center;" colspan="2"><b>Playing Golf</b></td>
233
- </tr>
234
- <tr>
235
- <td><img src=assets/sports_results/riding_horse/A_Royal_Guard_riding_a_horse_in_front_of_Buckingham_Palace_4490970.gif></td>
236
- <td><img src=assets/sports_results/riding_horse/A_man_riding_an_elephant_through_the_jungle_6230765.gif></td>
237
- <td><img src=assets/sports_results/playing_golf/A_man_is_playing_golf_in_front_of_the_White_House_8870450.gif></td>
238
- <td><img src=assets/sports_results/playing_golf/A_monkey_is_playing_golf_on_a_field_full_of_flowers_2989633.gif></td>
239
- </tr>
240
- <tr>
241
- <td width=25% style="text-align:center;">"A Royal Guard riding a horse in front of Buckingham Palace.” </br> seed: 4490970</td>
242
- <td width=25% style="text-align:center;">"A man riding an elephant through the jungle.” </br> seed: 6230765</td>
243
- <td width=25% style="text-align:center;">"A man is playing golf in front of the White House." </br> seed: 8870450</td>
244
- <td width=25% style="text-align:center;">"A monkey is playing golf on a field full of flowers." </br> seed: 2989633</td>
245
- <tr>
246
- </table>
247
-
248
- More sports, to be continued ...
249
-
250
- ## MotionDirector for Cinematic Shots <a name="MotionDirector_for_Cinematic_Shots"></a>
251
-
252
- ### 1. Zoom
253
- #### 1.1 Dolly Zoom (Hitchcockian Zoom)
254
- ```bash
255
- python MotionDirector_inference.py --model /path/to/the/ZeroScope --prompt "A firefighter standing in front of a burning forest captured with a dolly zoom." --checkpoint_folder ./outputs/train/dolly_zoom/ --checkpoint_index 150 --noise_prior 0.5 --seed 9365597
256
- ```
257
- <table class="center">
258
- <tr>
259
- <td style="text-align:center;"><b>Reference Video</b></td>
260
- <td style="text-align:center;" colspan="3"><b>Videos Generated by MotionDirector</b></td>
261
- </tr>
262
- <tr>
263
- <td><img src=assets/cinematic_shots_results/dolly_zoom_16.gif></td>
264
- <td><img src=assets/cinematic_shots_results/A_firefighter_standing_in_front_of_a_burning_forest_captured_with_a_dolly_zoom_9365597.gif></td>
265
- <td><img src=assets/cinematic_shots_results/A_lion_sitting_on_top_of_a_cliff_captured_with_a_dolly_zoom_1675932.gif></td>
266
- <td><img src=assets/cinematic_shots_results/A_Roman_soldier_standing_in_front_of_the_Colosseum_captured_with_a_dolly_zoom_2310805.gif></td>
267
- </tr>
268
- <tr>
269
- <td width=25% style="text-align:center;color:gray;">"A man standing in room captured with a dolly zoom."</td>
270
- <td width=25% style="text-align:center;">"A firefighter standing in front of a burning forest captured with a dolly zoom." </br> seed: 9365597 </br> noise_prior: 0.5</td>
271
- <td width=25% style="text-align:center;">"A lion sitting on top of a cliff captured with a dolly zoom." </br> seed: 1675932 </br> noise_prior: 0.5</td>
272
- <td width=25% style="text-align:center;">"A Roman soldier standing in front of the Colosseum captured with a dolly zoom." </br> seed: 2310805 </br> noise_prior: 0.5 </td>
273
- </tr>
274
- <tr>
275
- <td><img src=assets/cinematic_shots_results/dolly_zoom_16.gif></td>
276
- <td><img src=assets/cinematic_shots_results/A_firefighter_standing_in_front_of_a_burning_forest_captured_with_a_dolly_zoom_4615820.gif></td>
277
- <td><img src=assets/cinematic_shots_results/A_lion_sitting_on_top_of_a_cliff_captured_with_a_dolly_zoom_4114896.gif></td>
278
- <td><img src=assets/cinematic_shots_results/A_Roman_soldier_standing_in_front_of_the_Colosseum_captured_with_a_dolly_zoom_7492004.gif></td>
279
- </tr>
280
- <tr>
281
- <td width=25% style="text-align:center;color:gray;">"A man standing in room captured with a dolly zoom."</td>
282
- <td width=25% style="text-align:center;">"A firefighter standing in front of a burning forest captured with a dolly zoom." </br> seed: 4615820 </br> noise_prior: 0.3</td>
283
- <td width=25% style="text-align:center;">"A lion sitting on top of a cliff captured with a dolly zoom." </br> seed: 4114896 </br> noise_prior: 0.3</td>
284
- <td width=25% style="text-align:center;">"A Roman soldier standing in front of the Colosseum captured with a dolly zoom." </br> seed: 7492004</td>
285
- </tr>
286
- </table>
287
-
288
- #### 1.2 Zoom In
289
- The reference video is shot with my own water cup. You can also pick up your cup or any other object to practice camera movements and turn it into imaginative videos. Create your AI films with customized camera movements!
290
-
291
- ```bash
292
- python MotionDirector_inference.py --model /path/to/the/ZeroScope --prompt "A firefighter standing in front of a burning forest captured with a zoom in." --checkpoint_folder ./outputs/train/zoom_in/ --checkpoint_index 150 --noise_prior 0.3 --seed 1429227
293
- ```
294
- <table class="center">
295
- <tr>
296
- <td style="text-align:center;"><b>Reference Video</b></td>
297
- <td style="text-align:center;" colspan="3"><b>Videos Generated by MotionDirector</b></td>
298
- </tr>
299
- <tr>
300
- <td><img src=assets/cinematic_shots_results/zoom_in_16.gif></td>
301
- <td><img src=assets/cinematic_shots_results/A_firefighter_standing_in_front_of_a_burning_forest_captured_with_a_zoom_in_1429227.gif></td>
302
- <td><img src=assets/cinematic_shots_results/A_lion_sitting_on_top_of_a_cliff_captured_with_a_zoom_in_487239.gif></td>
303
- <td><img src=assets/cinematic_shots_results/A_Roman_soldier_standing_in_front_of_the_Colosseum_captured_with_a_zoom_in_1393184.gif></td>
304
- </tr>
305
- <tr>
306
- <td width=25% style="text-align:center;color:gray;">"A cup in a lab captured with a zoom in."</td>
307
- <td width=25% style="text-align:center;">"A firefighter standing in front of a burning forest captured with a zoom in." </br> seed: 1429227</td>
308
- <td width=25% style="text-align:center;">"A lion sitting on top of a cliff captured with a zoom in." </br> seed: 487239 </td>
309
- <td width=25% style="text-align:center;">"A Roman soldier standing in front of the Colosseum captured with a zoom in." </br> seed: 1393184</td>
310
- </tr>
311
- </table>
312
-
313
- #### 1.3 Zoom Out
314
- ```bash
315
- python MotionDirector_inference.py --model /path/to/the/ZeroScope --prompt "A firefighter standing in front of a burning forest captured with a zoom out." --checkpoint_folder ./outputs/train/zoom_out/ --checkpoint_index 150 --noise_prior 0.3 --seed 4971910
316
- ```
317
- <table class="center">
318
- <tr>
319
- <td style="text-align:center;"><b>Reference Video</b></td>
320
- <td style="text-align:center;" colspan="3"><b>Videos Generated by MotionDirector</b></td>
321
- </tr>
322
- <tr>
323
- <td><img src=assets/cinematic_shots_results/zoom_out_16.gif></td>
324
- <td><img src=assets/cinematic_shots_results/A_firefighter_standing_in_front_of_a_burning_forest_captured_with_a_zoom_out_4971910.gif></td>
325
- <td><img src=assets/cinematic_shots_results/A_lion_sitting_on_top_of_a_cliff_captured_with_a_zoom_out_1767994.gif></td>
326
- <td><img src=assets/cinematic_shots_results/A_Roman_soldier_standing_in_front_of_the_Colosseum_captured_with_a_zoom_out_8203639.gif></td>
327
- </tr>
328
- <tr>
329
- <td width=25% style="text-align:center;color:gray;">"A cup in a lab captured with a zoom out."</td>
330
- <td width=25% style="text-align:center;">"A firefighter standing in front of a burning forest captured with a zoom out." </br> seed: 4971910</td>
331
- <td width=25% style="text-align:center;">"A lion sitting on top of a cliff captured with a zoom out." </br> seed: 1767994 </td>
332
- <td width=25% style="text-align:center;">"A Roman soldier standing in front of the Colosseum captured with a zoom out." </br> seed: 8203639</td>
333
- </tr>
334
- </table>
335
-
336
- More Cinematic Shots, to be continued ....
337
-
338
- ## More results
339
-
340
- If you have a more impressive MotionDirector or generated videos, please feel free to open an issue and share them with us. We would greatly appreciate it.
341
- Improvements to the code are also highly welcome.
342
-
343
- Please refer to [Project Page](https://showlab.github.io/MotionDirector) for more results.
344
-
345
-
346
- ## Citation
347
-
348
-
349
- ```bibtex
350
-
351
- @article{zhao2023motiondirector,
352
- title={MotionDirector: Motion Customization of Text-to-Video Diffusion Models},
353
- author={Zhao, Rui and Gu, Yuchao and Wu, Jay Zhangjie and Zhang, David Junhao and Liu, Jiawei and Wu, Weijia and Keppo, Jussi and Shou, Mike Zheng},
354
- journal={arXiv preprint arXiv:2310.08465},
355
- year={2023}
356
- }
357
-
358
- ```
359
-
360
- ## Shoutouts
361
-
362
- - This code builds on [diffusers](https://github.com/huggingface/diffusers) and [Text-To-Video-Finetuning](https://github.com/ExponentialML/Text-To-Video-Finetuning). Thanks for open-sourcing!
363
- - Thanks to [camenduru](https://twitter.com/camenduru) for the [colab demo](https://github.com/camenduru/MotionDirector-colab).
364
- - Thanks to [yhyu13](https://github.com/yhyu13) for the [Huggingface Repo](https://huggingface.co/Yhyu13/MotionDirector_LoRA).