Views
No views yet











[2024-12-10]:🔥 The gradio interface is released! Many thanks to @gluttony-10 for his contribution! Other codes will be released very soon. Stay tuned![2024-12-6]:🔥 All data preprocessing codes (human skeleton extraction and human face mask extraction) are released! The training code and detailed training tutorial will be released before 2024.12.13. Stay tuned![2024-12-4]:🔥 We are thrilled to release an interesting dance demo (🔥🔥APT Dance🔥🔥)! The generated video can be seen on YouTube and Bilibili.[2024-11-28]:🔥 The data pre-processing codes (human skeleton extraction) are available! Other codes will be released very soon. Stay tuned![2024-11-26]:🔥 The project page, code, technical report and a basic model checkpoint are released. Further training codes, data pre-processing codes, the evaluation dataset and StableAnimator-pro will be released very soon. Stay tuned!pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu124
pip install torch==2.5.1+cu124 xformers --index-url https://download.pytorch.org/whl/cu124
pip install -r requirements.txtexport HF_ENDPOINT=https://hf-mirror.com.
Please download weights manually as follows:cd StableAnimator
git lfs install
git clone https://huggingface.co/FrancisRing/StableAnimator checkpointsStableAnimator/
├── DWPose
├── animation
├── checkpoints
│ ├── DWPose
│ │ ├── dw-ll_ucoco_384.onnx
│ │ └── yolox_l.onnx
│ ├── Animation
│ │ ├── pose_net.pth
│ │ ├── face_encoder.pth
│ │ └── unet.pth
│ ├── SVD
│ │ ├── feature_extractor
│ │ ├── image_encoder
│ │ ├── scheduler
│ │ ├── unet
│ │ ├── vae
│ │ ├── model_index.json
│ │ ├── svd_xt.safetensors
│ │ └── svd_xt_image_decoder.safetensors
│ └── inference.zip
├── models
│ │ └── antelopev2
│ │ ├── 1k3d68.onnx
│ │ ├── 2d106det.onnx
│ │ ├── genderage.onnx
│ │ ├── glintr100.onnx
│ │ └── scrfd_10g_bnkps.onnx
├── app.py
├── command_basic_infer.sh
├── inference_basic.py
├── requirement.txt inference.zip in checkpoints. Please download evaluation samples manually as follows:cd StableAnimator
mkdir inferenceinference/
├── case-1
│ ├── poses
│ ├── faces
│ └── reference.png
├── case-2
│ ├── poses
│ ├── faces
│ └── reference.png
├── case-3
│ ├── poses
│ ├── faces
│ └── reference.png/DWPose/dwpose_utils/wholebody.py:onnx_det = 'path/checkpoints/DWPose/yolox_l.onnx'
onnx_pose = 'path/checkpoints/DWPose/dw-ll_ucoco_384.onnx'python skeleton_extraction.py --target_image_folder_path="path/test/target_images" --ref_image_path="path/test/reference.png" --poses_folder_path="path/test/poses"frame_i.png, such as frame_0.png, frame_1.png, and so on.
--ref_image_path refers to the path of the given reference image. The obtained human skeleton images are saved in path/test/poses. It is particularly significant that the target skeleton images should be aligned with the reference image regarding the body shape.ffmpeg to convert the MP4 file to multiple frames (.png files) without any quality loss.ffmpeg -i target.mp4 -q:v 1 path/test/target_images/frame_%d.pngpath/test/target_images..png files, you can run the following command to extract the corresponding human face masks:python face_mask_extraction.py --image_folder="path/StableAnimator/inference/your_case/target_images"path/StableAnimator/inference/your_case/target_images contains multiple .png files. The obtained masks are saved in path/StableAnimator/inference/your_case/faces.command_basic_infer.sh. You can also easily modify the various configurations according to your needs.bash command_basic_infer.shcommand_basic_infer.sh to set the resolution of the animation. "--output_dir" in command_basic_infer.sh refers to the saved path of the generated animation. "--validation_control_folder" and "--validation_image" in command_basic_infer.sh refer to the paths of the given pose sequence and the reference image, respectively.
"--pretrained_model_name_or_path" in command_basic_infer.sh is the path of pretrained SVD. "posenet_model_name_or_path", "face_encoder_model_name_or_path", and "unet_model_name_or_path" in command_basic_infer.sh refer to paths of pretrained StableAnimator weights.
If you have enough GPU resources, you can increase the value (4=>8=>16) of "--decode_chunk_size" in command_basic_infer.sh to promote the temporal smoothness of the animation.cd animated_images
ffmpeg -framerate 20 -i frame_%d.png -c:v libx264 -crf 10 -pix_fmt yuv420p /path/animation.mp4python app.py1@article{tu2024stableanimator,
2 title={StableAnimator: High-Quality Identity-Preserving Human Image Animation},
3 author={Shuyuan Tu and Zhen Xing and Xintong Han and Zhi-Qi Cheng and Qi Dai and Chong Luo and Zuxuan Wu},
4 journal={arXiv preprint arXiv:2411.17697},
5 year={2024}
6}