Deep-Live-Cam

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:
Python 3.10 (recommended): Download and install from python.org.
Git: Download and install from git-scm.com.
FFmpeg: Install via FFmpeg's official site or use the command:
iex (irm ffmpeg.tc.ht)
Visual Studio 2022 Runtimes: Download from Microsoft's website.
For macOS:
Python 3.10: Install via Homebrew:
brew install python@3.10
Git: Install via Homebrew:
brew install git
FFmpeg: Install via Homebrew:
brew install ffmpeg
Python Tkinter (for GUI):
brew install python-tk@3.10
For Linux (Ubuntu/Debian):
Python 3.10:
sudo apt update sudo apt install python3.10 python3.10-venv python3.10-dev
Git:
sudo apt install git
FFmpeg:
sudo apt install ffmpeg
Step 2: Clone the Repository
Open a terminal or command prompt.
Clone the Deep-Live-Cam repository:
git clone https://github.com/hacksider/Deep-Live-Cam.git
Navigate to the project directory:
cd Deep-Live-Cam
Step 3: Download Required Models
Download the following models:
GFPGANv1.4: Download Link
inswapper_128_fp16.onnx: Download Link
Place these files in the
models
folder inside the project directory.
Step 4: Set Up a Virtual Environment
Create a virtual environment:
python -m venv venv
Activate the virtual environment:
Windows:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process venv\Scripts\activate
macOS/Linux:
source venv/bin/activate
Step 5: Install Dependencies
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):
Install CUDA Toolkit 11.8.0 from NVIDIA's website.
Install the GPU version of
onnxruntime
:pip uninstall onnxruntime onnxruntime-gpu pip install onnxruntime-gpu==1.16.3
Run the program with CUDA:
python run.py --execution-provider cuda
For Apple Silicon (CoreML):
Install the CoreML version of
onnxruntime
:pip uninstall onnxruntime onnxruntime-silicon pip install onnxruntime-silicon==1.13.1
Run the program with CoreML:
python run.py --execution-provider coreml
For Windows (DirectML):
Install the DirectML version of
onnxruntime
:pip uninstall onnxruntime onnxruntime-directml pip install onnxruntime-directml==1.15.1
Run the program with DirectML:
python run.py --execution-provider directml
For Intel CPUs (OpenVINO):
Install the OpenVINO version of
onnxruntime
:pip uninstall onnxruntime onnxruntime-openvino pip install onnxruntime-openvino==1.15.0
Run the program with OpenVINO:
python run.py --execution-provider openvino
Step 7: Run Deep-Live-Cam
Start the program:
python run.py
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.
Subscribe to my newsletter
Read articles from user101103 directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
