Deep Live Cam is a project for creating real-time face swaps and one-click video deepfakes using a single image. This tutorial will guide you through the installation and basic usage.
Prerequisites
- Python (3.10 recommended)
- pip
- git
- FFmpeg
- Visual Studio 2022 runtimes (for Windows users)
Installation
Step 1: Clone the Repository
- Open a terminal or command prompt.
- Run the following command:
git clone https://github.com/hacksider/Deep-Live-Cam.git
- Navigate to the cloned directory:
cd Deep-Live-Cam
Step 2: Download Required Models
- Visit the project's Hugging Face page.
- Download the following models:
- GFPGANv1.4
- inswapper_128_fp16.onnx
- Place these files in the
models
folder of the cloned repository.
Step 3: Install Dependencies
- Install the required packages:
pip install -r requirements.txt
Step 4: GPU Acceleration Setup (Optional)
For NVIDIA GPUs:
- Install CUDA Toolkit 11.8
- Install additional dependencies:
pip uninstall onnxruntime onnxruntime-gpu pip install onnxruntime-gpu==1.16.3
For Apple Silicon:
- Install CoreML dependencies:
pip uninstall onnxruntime onnxruntime-silicon pip install onnxruntime-silicon==1.13.1
For Windows DirectML:
- Install DirectML dependencies:
pip uninstall onnxruntime onnxruntime-directml pip install onnxruntime-directml==1.15.1
For Intel OpenVINO:
- Install OpenVINO dependencies:
pip uninstall onnxruntime onnxruntime-openvino pip install onnxruntime-openvino==1.15.0
Usage
Basic Usage
Run the application with:
python run.py
GPU-Accelerated Usage
For NVIDIA GPUs:
python run.py --execution-provider cuda
For Apple Silicon:
python run.py --execution-provider coreml
For Windows DirectML:
python run.py --execution-provider directml
For Intel OpenVINO:
python run.py --execution-provider openvino
Interface
- Select a face image using the "Choose Face" button.
- For live webcam mode:
- Click "Live" to use your webcam feed.
- For video processing:
- Select a target video using the "Choose Target" button.
- Click "Start" to begin processing.
Additional Options
- Face Enhancer: Improves output quality (may slow down processing)
- Many Faces: Processes every face in the frame
- Keep FPS: Maintains original video frame rate
- Keep Audio: Preserves original audio
Command Line Arguments
For advanced usage, you can use the following command line arguments:
-
-s
,--source
: Select source image -
-t
,--target
: Select target image or video -
-o
,--output
: Specify output file or directory -
--frame-processor
: Choose frame processors -
--keep-fps
: Keep original FPS -
--keep-audio
: Keep original audio -
--many-faces
: Process every face -
--video-encoder
: Adjust output video encoder -
--video-quality
: Adjust output video quality -
--max-memory
: Set maximum RAM usage -
--execution-threads
: Set number of execution threads
Notes
- Processing speed depends on your hardware. GPU acceleration significantly improves performance.
- For live webcam mode, ensure your webcam is properly connected and recognized by your system.
- Always use this software responsibly and ethically.
Top comments (0)