Home

Awesome

<div align="center"> <h2><font color="red"> Follow-Your-Emoji </font></center> <br> <center>Fine-Controllable and Expressive Freestyle Portrait Animation</h2>

Yue Ma*, Hongyu Liu*, Hongfa Wang*, Heng Pan*, Yingqing He, Junkun Yuan, Ailing Zeng, Chengfei Cai, Heung-Yeung Shum, Wei Liu and Qifeng Chen

<strong>is Accpeted by Siggraph Asia 2024</strong>

<a href='https://arxiv.org/abs/2406.01900'><img src='https://img.shields.io/badge/ArXiv-2406.01900-red'></a> <a href='https://github.com/daswer123/FollowYourEmoji-colab/blob/main/README.md'><img src='https://colab.research.google.com/assets/colab-badge.svg'></a> <a href='https://follow-your-emoji.github.io/'><img src='https://img.shields.io/badge/Project-Page-Green'></a> <a href='assets/wechat_group.png'><img src='https://badges.aleen42.com/src/wechat.svg'></a> visitors Open in OpenXLab GitHub

</div> <!-- <table class="center"> <td><img src="https://follow-your-emoji.github.io/src/teaser/teaser.gif"></td> <tr> <td align="center" >๐Ÿคช For more results, visit our <a href="https://follow-your-emoji.github.io/"><strong>homepage</strong></td> <tr> </td> </table > --> <!-- - **[2024.07.29]** ๐Ÿ”ฅ Our paper is conditional accpeted by Siggraph Asia 2024! -->

๐Ÿ“ฃ Updates

๐Ÿคช Gallery

<img src="images/index.png" alt="Image 1"> <p>We present <span style="color: #c20557ee">Follow-Your-Emoji</span>, a diffusion-based framework for portrait animation, which animates a reference portrait with target landmark sequences.</p>

๐Ÿคช Getting Started

1. Clone the code and prepare the environment

pip install -r requirements.txt

2. Download pretrained weights

[FollowYourEmoji] We also provide our pretrained checkpoints in Huggingface. you could download them and put them into checkpoints folder to inference our model.

Finally, these pretrained models should be organized as follows:

pretrained_models
โ”œโ”€โ”€ AnimateDiff
โ”‚ย ย  โ””โ”€โ”€ mm_sd_v15_v2.ckpt
โ”œโ”€โ”€ follow-your-emoji
โ”‚ย ย  โ”œโ”€โ”€ lmk_guider.pth
โ”‚ย ย  โ”œโ”€โ”€ referencenet.pth
โ”‚ย ย  โ””โ”€โ”€ unet.pth
โ”œโ”€โ”€ sd-image-variations-diffusers
โ”‚ย ย  โ”œโ”€โ”€ alias-montage.jpg
โ”‚ย ย  โ”œโ”€โ”€ default-montage.jpg
โ”‚ย ย  โ”œโ”€โ”€ earring.jpg
โ”‚ย ย  โ”œโ”€โ”€ feature_extractor
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ preprocessor_config.json
โ”‚ย ย  โ”œโ”€โ”€ image_encoder
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ config.json
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ pytorch_model.bin
โ”‚ย ย  โ”œโ”€โ”€ inputs.jpg
โ”‚ย ย  โ”œโ”€โ”€ model_index.json
โ”‚ย ย  โ”œโ”€โ”€ README.md
โ”‚ย ย  โ”œโ”€โ”€ safety_checker
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ config.json
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ pytorch_model.bin
โ”‚ย ย  โ”œโ”€โ”€ scheduler
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ scheduler_config.json
โ”‚ย ย  โ”œโ”€โ”€ unet
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ config.json
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ diffusion_pytorch_model.bin
โ”‚ย ย  โ”œโ”€โ”€ v1-montage.jpg
โ”‚ย ย  โ”œโ”€โ”€ v2-montage.jpg
โ”‚ย ย  โ””โ”€โ”€ vae
โ”‚ย ย      โ”œโ”€โ”€ config.json
โ”‚ย ย      โ””โ”€โ”€ diffusion_pytorch_model.bin
โ””โ”€โ”€ sd-vae-ft-mse
    โ”œโ”€โ”€ config.json
    โ”œโ”€โ”€ diffusion_pytorch_model.bin
    โ”œโ”€โ”€ diffusion_pytorch_model.safetensors
    โ””โ”€โ”€ README.md

3. Inference ๐Ÿš€

bash infer.sh
CUDA_VISIBLE_DEVICES=0 python3 -m torch.distributed.run \
    --nnodes 1 \
    --master_addr $LOCAL_IP \
    --master_port 12345 \
    --node_rank 0 \
    --nproc_per_node 1 \
    infer.py \
    --config ./configs/infer.yaml \
    --model_path /path/to/model \
    --input_path your_own_images_path \
    --lmk_path ./inference_temple/test_temple.npy  \
    --output_path your_own_output_path

๐Ÿคช Make Your Emoji

You can make your own emoji using our model. First, you need to make your emoji temple using MediaPipe. We provide the script in make_temple.ipynb. You can replace the video path with your own emoji video and generate the .npy file.

CUDA_VISIBLE_DEVICES=0 python3 -m torch.distributed.run \
    --nnodes 1 \
    --master_addr $LOCAL_IP \
    --master_port 12345 \
    --node_rank 0 \
    --nproc_per_node 1 \
    infer.py \
    --config ./configs/infer.yaml \
    --model_path /path/to/model \
    --input_path your_own_images_path \
    --lmk_path  your_own_temple_path \
    --output_path your_own_output_path

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Follow Family

Follow-Your-Pose: Pose-Guided text-to-Video Generation.

Follow-Your-Click: Open-domain Regional image animation via Short Prompts.

Follow-Your-Handle: Controllable Video Editing via Control Handle Transformations.

Follow-Your-Emoji: Fine-Controllable and Expressive Freestyle Portrait Animation.

Citation ๐Ÿ’–

If you find Follow-Your-Emoji useful for your research, welcome to ๐ŸŒŸ this repo and cite our work using the following BibTeX:

@article{ma2024follow,
  title={Follow-Your-Emoji: Fine-Controllable and Expressive Freestyle Portrait Animation},
  author={Ma, Yue and Liu, Hongyu and Wang, Hongfa and Pan, Heng and He, Yingqing and Yuan, Junkun and Zeng, Ailing and Cai, Chengfei and Shum, Heung-Yeung and Liu, Wei and others},
  journal={arXiv preprint arXiv:2406.01900},
  year={2024}
}