Step 1 - Download Live Portrait repository
Click on Code and then download Zip
Then create a folder called e.g. LivePortrait in place like Desktop or Documents. Then, copy all the content of the downloaded files into this folder
Step 2 - Download pretrained weights
Go to this link based on the Google Drive link below in https://github.com/KwaiVGI/LivePortrait
Download both folder into your local computer
Go to the
LivePortrait
folder you created in Step 1 and copy both of the folders intopretrained_weights
folder
Step 3 - Create conda environment
We will create a Python conda environment to run the code. For those of you who does not now what conda environment is, you can just imagine that it’s a place for you to install all the dependencies/software required to run the LivePortrait software.
Install Miniconda from https://docs.anaconda.com/miniconda/#miniconda-latest-installer-links
Create conda environment, the environment will be created at the default directory of conda (e.g. /opt/miniconda3/envs/LivePortrait for macOS or C:\Users\<YourUsername>\Miniconda3\envs\LivePortrait for Windows)
# create env using conda
conda create -n LivePortrait python=3.9
Activate conda environment
conda activate LivePortrait
Navigate to the LivePortrait directory and install requirements in your conda environment
# for Linux and Windows users
pip install -r requirements.txt
# for macOS with Apple Silicon users
# Edit the requirements_macOS.txt to change the version of onnxruntime-silicon==1.16.3 to onnxruntime-silicon==1.16.0
cd /Users/chenming/Documents/LivePortrait
pip install -r requirements_macOS.txt
Step 4 - Install ffmpeg
macOS
Install homebrew at https://github.com/Homebrew/brew/releases/tag/4.3.12
Install ffmpeg using Terminal, just open the Terminal app
Open Terminal
# Install ffmpeg using brew
brew install ffmpeg
# Verify that ffmpeg is installed
ffmpeg
Windows
Install by following this step here: https://phoenixnap.com/kb/ffmpeg-windows
Step 5 - Open web interface
# For Linux and Windows users
cd C:\Users\chenming\Documents\LivePortrait
python app.py
# for macOS with Intel
cd /Users/chenming/Documents/LivePortrait
python app.py
# For macOS with Apple Silicon users
cd /Users/chenming/Documents/LivePortrait
PYTORCH_ENABLE_MPS_FALLBACK=1 python app.py
You should see something like this 👇
Open your web url at:
http://127.0.0.1:8890