LivePortrait
LivePortrait 讓靜態人物照片具有生動表情
論文首頁
Paper: LivePortrait: Efficient Portrait Animation with Stitching and Retargeting Control
Pipeline of the first stage: base model training.
Pipeline of the second stage: stitching and retargeting modules training.
Github
1) 安裝與複製程式碼
sudo apt install ffmpeg
1
2
3
4
5
6
7
8
9
git clone https://github.com/KwaiVGI/LivePortrait
cd LivePortrait
# create env using conda
conda create -n LivePortrait
conda activate LivePortrait
# install dependencies
pip install -r requirements.txt
2) 下載預訓練模型
1
2
3
4
5
6
# first, ensure git-lfs is installed, see: https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage
git lfs install
# clone and move the weights
git clone https://huggingface.co/KwaiVGI/LivePortrait temp_pretrained_weights
mv temp_pretrained_weights/* pretrained_weights/
rm -rf temp_pretrained_weights
3) 執行
- 輸入來源是照片(512x512 大頭照), 驅動短片是d0.mp4 (頭像與語音)
1
python inference.py -s assets/examples/source/s9.jpg -d assets/examples/driving/d0.mp4
- 輸入來源是影片, 驅動短片是d0.mp4 (頭像與語音)
1
python inference.py -s assets/examples/source/s13.mp4 -d assets/examples/driving/d0.mp4
應用平台
python app.py
http://127.0.0.1:8890
展示影片