LivePortrait is a deep learning-based portrait-driven generation model that can transform static portraits into dynamic videos with realistic expressions and movements.
git clone https://huggingface.co/AXERA-TECH/LivePortrait
File Description:
m5stack@raspberrypi:~/rsp/LivePortrait $ ls -lh
total 16K
drwxrwxr-x 3 m5stack m5stack 4.0K Aug 13 09:41 assets
-rw-rw-r-- 1 m5stack m5stack 0 Aug 13 09:41 config.json
drwxrwxr-x 5 m5stack m5stack 4.0K Aug 13 09:41 python
-rw-rw-r-- 1 m5stack m5stack 5.7K Aug 13 09:41 README.md
python -m venv lvpr
source lvpr/bin/activate
pip install https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3.rc1/axengine-0.1.3-py3-none-any.whl
pip install -r python/requirements.txt
pip install requests tqdm
Run:
python ./python/infer.py --source ./assets/examples/source/s0.jpg --driving ./assets/examples/driving/d8.jpg --models ./python/axmodels/ --output-dir ./axmodel_infer
Run result:
(lvpr) m5stack@raspberrypi:~/rsp/LivePortrait $ python ./python/infer.py --source ./assets/examples/source/s0.jpg --driving ./assets/examples/driving/d8.jpg --models ./python/axmodels/ --output-dir ./axmodel_infer
[INFO] Available providers: ['AXCLRTExecutionProvider']
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 3.3 144960ad
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 3.3 144960ad
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 3.3 0f7260e8
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 3.3 144960ad
FaceAnalysisDIY warmup time: 0.237s
LandmarkRunner warmup time: 0.183s
2025-08-13 10:04:42.914 | INFO | __main__:main:727 - Start making driving motion template...
2025-08-13 10:04:43.782 | INFO | __main__:main:747 - Prepared pasteback mask done.
2025-08-13 10:04:44.565 | INFO | __main__:main:787 - The output of image-driven portrait animation is an image.
2025-08-13 10:04:50.566 | DEBUG | __main__:warp_decode:647 - warp time: 5.997s
2025-08-13 10:04:50.902 | INFO | __main__:main:881 - Animated image: ./axmodel_infer/s0--d8.jpg
2025-08-13 10:04:50.902 | INFO | __main__:main:882 - Animated image with concat: ./axmodel_infer/s0--d8_concat.jpg
2025-08-13 10:04:50.920 | DEBUG | __main__:<module>:894 - LivePortrait axmodel infer time: 18.068s
Original Image:
Output:
Run:
python ./python/infer.py --source ./assets/examples/source/s0.jpg --driving ./assets/examples/driving/d0.mp4 --models ./python/axmodels/ --output-dir ./axmodel_infer
Run result:
(lvpr) m5stack@raspberrypi:~/rsp/LivePortrait $ python ./python/infer.py --source ./assets/examples/source/s0.jpg --driving ./assets/examples/driving/d0.mp4 --models ./python/axmodels/ --output-dir ./axmodel_infer
[INFO] Available providers: ['AXCLRTExecutionProvider']
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 3.3 144960ad
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 3.3 144960ad
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 3.3 0f7260e8
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 3.3 144960ad
FaceAnalysisDIY warmup time: 0.213s
LandmarkRunner warmup time: 0.180s
2025-08-13 10:14:47.779 | INFO | __main__:main:727 - Start making driving motion template...
2025-08-13 10:15:04.110 | INFO | __main__:main:747 - Prepared pasteback mask done.
2025-08-13 10:15:04.903 | INFO | __main__:main:785 - The animated video consists of 78 frames.
2025-08-13 10:15:11.468 | DEBUG | __main__:warp_decode:647 - warp time: 6.561s
2025-08-13 10:25:50.630 | DEBUG | __main__:warp_decode:647 - warp time: 8.343s
2025-08-13 10:25:51.493 | INFO | __main__:has_audio_stream:114 - Error occurred while probing video: ./assets/examples/driving/d0.mp4, you may need to install ffprobe! (https://ffmpeg.org/download.html) Now set audio to false!
2025-08-13 10:25:54.608 | INFO | __main__:main:870 - Animated video: ./axmodel_infer/s0--d0.mp4
2025-08-13 10:25:54.609 | INFO | __main__:main:871 - Animated video with concat: ./axmodel_infer/s0--d0_concat.mp4
2025-08-13 10:25:54.644 | DEBUG | __main__:<module>:894 - LivePortrait axmodel infer time: 670.930s
Original Video:
Output: