video_LeviTor.mp4
Hanlin Wang1,2, Hao Ouyang2, Qiuyu Wang2, Wen Wang3,2, Ka Leong Cheng4,2, Qifeng Chen4, Yujun Shen2, Limin Wang†,1
1State Key Laboratory for Novel Software Technology, Nanjing University
2Ant Group 3Zhejiang University 4The Hong Kong University of Science and Technology
†corresponding author
- Release gradio demo on huggingface.
- [2024.12.20] 🎉 Exciting News: Interactive demo with gradio for LeviTor has been released!
Follow the following guide to set up the environment.
-
Git clone repo
git clone https://github.com/qiuyu96/LeviTor.git cd LeviTor
-
Download and unzip checkpoints
Creatcheckpoints
dir:mkdir checkpoints cd checkpoints
Download 'depth_anything_v2_vitl.pth' from Depth Anything V2
Download 'sam_vit_h_4b8939.pth' from Segment Anything
Download 'stable-video-diffusion-img2vid-xt' from stabilityai
Create LeviTor checkpoint directory:mkdir LeviTor cd LeviTor
Then download LeviTor checkpoint from LeviTor
Ensure all the checkpoints are in the
checkpoints
directory as:checkpoints/ |-- sam_vit_h_4b8939.pth |-- depth_anything_v2_vitl.pth |-- stable-video-diffusion-img2vid-xt/ |-- LeviTor/ |-- random_states_0.pkl |-- scaler.pt |-- scheduler.bin |-- controlnet/ |-- unet/
-
Create environment
conda create -n LeviTor python=3.9 -y conda activate LeviTor
-
Install packages
pip install -r requirements.txt
-
Install pytorch3d
pip install "git+https://github.com/facebookresearch/pytorch3d.git"
-
Install gradio
pip install gradio==4.36.1
-
Run LeviTor
python gradio_demo/gradio_run.py --frame_interval 1 --num_frames 16 --pretrained_model_name_or_path checkpoints/stable-video-diffusion-img2vid-xt --resume_from_checkpoint checkpoints/LeviTor --width 288 --height 512 --seed 217113 --mixed_precision fp16 --enable_xformers_memory_efficient_attention --output_dir ./outputs --gaussian_r 10 --sam_path checkpoints/sam_vit_h_4b8939.pth --depthanything_path checkpoints/depth_anything_v2_vitl.pth
Please read before you try!
Use the Upload Start Image to upload your image~
Note that if the current point you click on the image is in your interested area, input 1 in the Add SAM Point? box. Otherwise, input 0 to click a point in your uninterested area. Use the Add SAM Point? box to accurately selected the area you want.
Don't forget to cite this source if it proves useful in your research!
@article{wang2024levitor,
title={LeviTor: 3D Trajectory Oriented Image-to-Video Synthesis},
author={Hanlin Wang and Hao Ouyang and Qiuyu Wang and Wen Wang and Ka Leong Cheng and Qifeng Chen and Yujun Shen and Limin Wang},
year={2024},
eprint={2412.15214},
archivePrefix={arXiv},
primaryClass={cs.CV}}
Our implementation is based on
Thanks for their remarkable contribution and released code!
Note: This repo is governed by the license of Apache 2.0 We strongly advise users not to knowingly generate or allow others to knowingly generate harmful content, including hate speech, violence, pornography, deception, etc.
(注:本仓库受Apache 2.0的许可协议限制。我们强烈建议,用户不应传播及不应允许他人传播以下内容,包括但不限于仇恨言论、暴力、色情、欺诈相关的有害信息。)