Deep-Live-Cam

user101103user101103
3 min read

Here’s a step-by-step tutorial to install and set up Deep-Live-Cam manually on your system. This guide assumes you have basic knowledge of using the command line and installing software.


Step 1: Prerequisites

Before installing Deep-Live-Cam, ensure your system meets the following requirements:

For Windows:

  1. Python 3.10 (recommended): Download and install from python.org.

  2. Git: Download and install from git-scm.com.

  3. FFmpeg: Install via FFmpeg's official site or use the command:

     iex (irm ffmpeg.tc.ht)
    
  4. Visual Studio 2022 Runtimes: Download from Microsoft's website.

For macOS:

  1. Python 3.10: Install via Homebrew:

     brew install python@3.10
    
  2. Git: Install via Homebrew:

     brew install git
    
  3. FFmpeg: Install via Homebrew:

     brew install ffmpeg
    
  4. Python Tkinter (for GUI):

     brew install python-tk@3.10
    

For Linux (Ubuntu/Debian):

  1. Python 3.10:

     sudo apt update
     sudo apt install python3.10 python3.10-venv python3.10-dev
    
  2. Git:

     sudo apt install git
    
  3. FFmpeg:

     sudo apt install ffmpeg
    

Step 2: Clone the Repository

  1. Open a terminal or command prompt.

  2. Clone the Deep-Live-Cam repository:

     git clone https://github.com/hacksider/Deep-Live-Cam.git
    
  3. Navigate to the project directory:

     cd Deep-Live-Cam
    

Step 3: Download Required Models

  1. Download the following models:

  2. Place these files in the models folder inside the project directory.


Step 4: Set Up a Virtual Environment

  1. Create a virtual environment:

     python -m venv venv
    
  2. Activate the virtual environment:

    • Windows:

        Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
        venv\Scripts\activate
      
    • macOS/Linux:

        source venv/bin/activate
      

Step 5: Install Dependencies

  1. Install the required Python packages:

     pip install -r requirements.txt
    

Step 6: GPU Acceleration (Optional)

If you have a GPU, you can accelerate the processing by installing the appropriate execution provider.

For NVIDIA GPUs (CUDA):

  1. Install CUDA Toolkit 11.8.0 from NVIDIA's website.

  2. Install the GPU version of onnxruntime:

     pip uninstall onnxruntime onnxruntime-gpu
     pip install onnxruntime-gpu==1.16.3
    
  3. Run the program with CUDA:

     python run.py --execution-provider cuda
    

For Apple Silicon (CoreML):

  1. Install the CoreML version of onnxruntime:

     pip uninstall onnxruntime onnxruntime-silicon
     pip install onnxruntime-silicon==1.13.1
    
  2. Run the program with CoreML:

     python run.py --execution-provider coreml
    

For Windows (DirectML):

  1. Install the DirectML version of onnxruntime:

     pip uninstall onnxruntime onnxruntime-directml
     pip install onnxruntime-directml==1.15.1
    
  2. Run the program with DirectML:

     python run.py --execution-provider directml
    

For Intel CPUs (OpenVINO):

  1. Install the OpenVINO version of onnxruntime:

     pip uninstall onnxruntime onnxruntime-openvino
     pip install onnxruntime-openvino==1.15.0
    
  2. Run the program with OpenVINO:

     python run.py --execution-provider openvino
    

Step 7: Run Deep-Live-Cam

  1. Start the program:

     python run.py
    
  2. Follow the on-screen instructions:

    • Select a source face image.

    • Choose a target image/video or enable webcam mode.

    • Click "Start" or "Live" to begin processing.


Step 8: Usage Tips

  • Image/Video Mode: Use this mode to process pre-recorded videos or images.

  • Webcam Mode: Use this mode for real-time face swapping during live streams or video calls.

  • Command Line Arguments: Customize the program's behavior using CLI arguments (e.g., --frame-processor, --keep-fps, etc.).


Troubleshooting

  • Missing Dependencies: Ensure all prerequisites are installed correctly.

  • GPU Issues: Verify that your GPU drivers and CUDA toolkit are up to date.

  • Performance: Use a GPU for faster processing. CPU-only mode may be slow for high-resolution videos.


0
Subscribe to my newsletter

Read articles from user101103 directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

user101103
user101103