Wav2Lip Project Setup Guide

Follow these steps to set up the Wav2Lip project on your Mac system. This guide covers installation of Python, setting up a virtual environment, cloning the Wav2Lip repository, and other necessary setup tasks.

Initial Setup Steps

  1. Install Homebrew, a package manager for macOS, by running the following command in your terminal:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Use Homebrew to install Pyenv:
    brew install pyenv
  3. Create a project directory named Wav2LipProject:
    mkdir Wav2LipProject
  4. Navigate to Wav2LipProject:
  5. Use Pyenv to install Python 3.6:
    pyenv install 3.6.15
  6. Set Local Version:
    pyenv local 3.6.15
                                
  7. Create virtual env using venv:
    python -m venv Wav2LipEnv
  8. Activate the Python 3.6 virtual environment:
    source Wav2LipEnv/bin/activate
  9. Verify the running version of Python:
    python3 --version
  10. Clone the Wav2Lip GitHub repository:
    git clone https://github.com/Rudrabha/Wav2Lip.git
            cd Wav2Lip
  11. Update pip:
    pip install --upgrade pip
  12. Install OpenCV:
    pip install opencv-contrib-python==4.2.0.34
  13. Install necessary Python libraries from requirements.txt:
    pip install -r requirements.txt
  14. Download the pretrained model weights from the repository:
    Download wav2lip_gan.pth from this repository, place it into the checkpoints folder.
  15. Verify the installation by running a simple script:
    python inference.py --checkpoint_path path-to-wav2lip_gan.pth --face path-to-video.mp4 --audio path-to-audio.wav
  16. Final Product should appear in the results folder.

Tips for Using Wav2Lip

  • Always ensure the environment in the wav2lip_env directory is running python 3.6 before running scripts.
  • Video must be mp4 and audio must be .wav
  • Better results using lower quality video. Compressing to 1080 looks best. 720 executes faster but generates poor results.
  • Ensure the Wav2Lip directory is correctly set up before proceeding.
  • Ensure that the video is not longer than the audio
  • Run the main script for synchronization in the Wav2Lip directory.