Discover Deep Live Cam, the open-source powerhouse for seamless real-time face swaps using AI. This guide walks you through setup on Windows, Linux, and Mac, plus pro tips for stunning results.
## Introduction to Deep Live Cam
Deep Live Cam stands out as a cutting-edge, open-source application designed for real-time face swapping powered by advanced AI models. Leveraging technologies like InsightFace and ONNX runtime, it enables users to swap faces between a source image or webcam feed and a target video or stream with impressive speed and accuracy. Whether you're experimenting with creative content, testing AI capabilities, or building fun applications, this tool delivers professional-grade results without needing high-end hardware.
Originally developed as a user-friendly interface for complex face manipulation models, Deep Live Cam simplifies the process that typically requires deep technical knowledge. It's particularly popular among content creators, developers, and AI enthusiasts for its low-latency performance—often achieving 20-30 FPS on consumer GPUs.
Key advantages include:
- **Real-time processing**: No waiting for renders; swaps happen live.
- **Multi-face support**: Handles multiple faces in a single frame.
- **Flexible inputs**: Use static images, webcams, or even IP cameras as sources.
- **Cross-platform compatibility**: Works on Windows, Linux, and macOS (with some caveats).
- **Customizable quality**: Options for execution providers like CUDA, DirectML, or TensorRT.
The project is hosted on [GitHub](https://github.com/hacksider/Deep-Live-Cam), where you'll find the latest releases, issues, and community contributions.
## Core Features and How They Work
At its heart, Deep Live Cam uses the InsightFace library for face detection, landmark extraction, and swapping. The pipeline involves:
1. **Face Detection**: Identifies faces in both source and target using models like Buffalo_L.
2. **Embedding Extraction**: Generates 512-dimensional face embeddings for matching.
3. **Swapping**: Applies the source embedding to the target face via a generator model like inswapper_128.onnx.
4. **Blending**: Seamlessly composites the swapped face back into the frame.
Additional enhancements include face enhancers (e.g., GFPGAN, CodeFormer) for post-processing to improve realism, and options for saving output as MP4 or image sequences.
For real-world scenarios, imagine a streamer swapping their face onto a celebrity during a live broadcast, or a marketer creating personalized video ads dynamically. The tool's efficiency stems from ONNX optimization, allowing it to run on NVIDIA GPUs (CUDA), AMD/Intel (DirectML on Windows), or even CPU for lighter loads.
## System Requirements
To get started, ensure your setup meets these specs:
- **GPU**: NVIDIA with CUDA 11.8+ (recommended for best performance), or DirectML-compatible for Windows.
- **RAM**: 8GB minimum, 16GB+ for smooth multi-face swaps.
- **Storage**: ~10GB for models and dependencies.
- **OS**: Windows 10/11, Ubuntu 22.04+, or macOS (Apple Silicon preferred, but Intel has limitations).
No internet required post-installation, as all models download locally.
## Step-by-Step Installation Guide
### Windows: Easiest One-Click Setup
Windows users benefit from a portable executable—no Python install needed.
1. Download the latest release from [GitHub](https://github.com/hacksider/Deep-Live-Cam/releases).
2. Extract the ZIP to a folder (e.g., `C:\\DeepLiveCam`).
3. Run `run.exe`—it auto-downloads ~6GB of models on first launch.
4. Select your execution provider: CUDA for NVIDIA, DirectML for others.
**Pro Tip**: For AMD/Intel GPUs, install DirectML via `pip install onnxruntime-directml` if issues arise.
**Example Command for Custom Install**:
```bash
pip install -r requirements.txt
python download_models.py
python run.py
```
### Linux (Ubuntu/Debian)
Linux setup requires Docker or manual Python env for stability.
1. Install dependencies:
```bash
sudo apt update && sudo apt install python3.10 python3.10-venv python3-pip
```
2. Clone the repo:
```bash
git clone https://github.com/hacksider/Deep-Live-Cam.git
cd Deep-Live-Cam
```
3. Create venv and install:
```bash
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```
4. Download models: `python download_models.py`.
5. Run: `python run.py`.
**Docker Alternative** (zero-host setup):
```bash
docker pull ghcr.io/hacksider/deep-live-cam:main
# Mount volumes for inputs/outputs
```
**Real-World Note**: On Ubuntu 22.04 with RTX 3060, expect 25 FPS with CUDA.
### macOS: Apple Silicon Focus
M1/M2/M3 Macs use CoreML for acceleration.
1. Install Homebrew: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`.
2. Clone and setup as Linux, but use `pip install onnxruntime-coreml`.
3. Download models and run.
**Caveat**: Intel Macs may fall back to CPU, reducing FPS to <10.
## Using Deep Live Cam: Practical Walkthrough
Launch the Gradio-based UI via `run.py` or executable. The interface is intuitive:
### Basic Face Swap
1. **Source Face**: Drag an image or select webcam/IP camera (format: `rtsp://ip:port/stream`).
2. **Target Video**: Upload video/image or live feed.
3. **Settings**:
- Face Selector Mode: One (default), Multiple Faces, or Average All.
- Enhance: Enable GFPGAN (0.5-1.0 creep strength) for better skin/detail.
- Output: Save as MP4, GIF, or stream to browser.
4. Click **Start**—watch the magic in the preview window.
**Code Snippet for Automation** (via API mode):
```python
import subprocess
subprocess.run(['python', 'run.py', '--api', '--execution-provider', 'cuda'])
# Then POST to http://127.0.0.1:7860/swap with JSON payload
```
### Advanced Scenarios
- **Live Streaming**: Set target as `screen-capture-recorder` or OBS virtual cam integration.
- **Batch Processing**: Script multiple sources/targets via loop in Python.
- **Custom Models**: Drop new .onnx files into `models/` folder.
**Example Output FPS Benchmarks**:
| GPU | Provider | Resolution | FPS |
|-----|----------|------------|-----|
| RTX 4090 | CUDA | 1080p | 60+ |
| RX 7900 | DirectML | 720p | 30 |
| M2 Max | CoreML | 720p | 25 |
## Troubleshooting Common Issues
- **CUDA Out of Memory**: Reduce resolution or use FP16 mode (`--fp16` flag).
- **No Face Detected**: Ensure good lighting; try `--execution-threads 4`.
- **Model Download Fails**: Manual download from [InsightFace models](https://github.com/facefusion/facefusion) or use `--skip-download`.
- **Gradio UI Blank**: Check ports (default 7860); `--listen 0.0.0.0` for remote access.
- **Mac Crashes**: Update Xcode tools and use `--coreml`.
Community forums on GitHub are goldmines for fixes—search issues first.
## Ethical Considerations and Best Practices
Face swapping tech is powerful but raises privacy concerns. Always:
- Obtain consent for real people.
- Label deepfakes clearly.
- Avoid misinformation (e.g., political videos).
Enhance outputs with post-processing in tools like Adobe Premiere for production use.
## Future Potential and Extensions
Deep Live Cam's modular design invites extensions: Integrate with Stable Diffusion for full-body swaps or WebRTC for browser-based apps. Contribute via [GitHub](https://github.com/hacksider/Deep-Live-Cam) by adding providers or UI features.
In summary, this tool democratizes AI face manipulation, making it accessible for hobbyists and pros alike. Dive in, experiment, and create responsibly.
---
<div style="text-align: center; margin-top: 2rem;">
<a href="https://www.analyticsvidhya.com/blog/2025/05/deep-live-cam/" target="_blank" rel="noopener noreferrer" class="view-full-resource-btn" style="display: inline-block; background-color: #f97316; color: white; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: background-color 0.2s;">View Full Resource</a>
</div>