Skip to content

ars-system/LivePortrait

 
 

Repository files navigation

LivePortrait: CPU-Optimized (Humans Only)


showcase
🔥 Optimized for **Human Portrait Animation** on simple CPU machines (e.g., Core i3, 8GB RAM) 🔥

Introduction 📖

This repository is a specialized version of LivePortrait, optimized for execution on low-end hardware and CPU-only systems. It focuses exclusively on Human Mode to reduce disk space (by ~1.5GB) and overhead.

Key Features (Optimized)

  • CPU Inference: Pre-configured for stable CPU performance.
  • Low Memory Footprint: Efficiently runs on systems with 8GB RAM.
  • Simplified Setup: One-click batch files for Windows with pre-configured environment paths.
  • Human-Centric: All animal mode components and large weights have been removed for speed and clarity.

Getting Started 🏁

1. Prepare the Environment 🛠️

Note

Ensure you have git, conda, and FFmpeg installed.

# RECOMMENDED: create env using conda
conda env create -f environment.yml
conda activate LivePortrait

The environment.yml handles all dependencies. Note: This setup uses gradio==4.44.1 and gradio-client==1.3.0 to resolve schema processing issues and localhost connectivity bugs specific to Windows/Conda environments.

Stability Fixes Applied:

  • Default server_name set to 127.0.0.1 for local stability.
  • show_api=False and max_threads=1 in app.py to prevent startup crashes.

2. Download Pretrained Weights 📥

Download weights and place them in ./pretrained_weights. The directory structure should match this (Human models only).

3. Inference 🚀

Windows One-Click

Simply double-click run_app.bat. This handles all necessary environment paths (including SSL DLL fixes for Conda).

Command Line

python inference.py -s assets/examples/source/s9.jpg -d assets/examples/driving/d0.mp4

4. Gradio Interface 🤗

Launch the web interface by running:

python app.py

Or use the provided run_app.bat.

Acknowledgements 💐

This project is based on the original LivePortrait by KwaiVGI. We thank the authors for their groundbreaking work in efficient portrait animation.

Citation 💖

@article{guo2024liveportrait,
  title   = {LivePortrait: Efficient Portrait Animation with Stitching and Retargeting Control},
  author  = {Guo, Jianzhu and Zhang, Dingyun and Liu, Xiaoqiang and Zhong, Zhizhou and Zhang, Yuan and Wan, Pengfei and Zhang, Di},
  journal = {arXiv preprint arXiv:2407.03168},
  year    = {2024}
}

About

Bring portraits to life!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 89.5%
  • Cuda 9.3%
  • Other 1.2%