deepfake in real time

Man

Professional
Messages
3,070
Reaction score
606
Points
113

How to Install Deep Live Cam and Replace Face in Real Time​


What's up, guys! Today we're going to install Deep Live Cam - a cool thing that allows you to swap faces on a webcam or in a video. Yes, now you can put your face on a photo of Jason Statham and feel cool... well, no, you won't.

Step 1. Preparing for installation​

Before you can run this mega-dragoon, you need to install a few things. If you don't have them, everything will go to hell.

1. Install Chocolatey (if you have Windows)

Run PowerShell as administrator and type:
Code:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('[URL]https://community.chocolatey.org/install.ps1[/URL]'))

2. Install Python 3.10, Git and FFmpeg:
Code:
choco install python --version=3.10.0 -y
choco install git -y
choco install ffmpeg -y

3. Check the installation:
Code:
python --version
git --version
ffmpeg -version

If there is a mistake somewhere, catch a bream and check the installation.

4. Install Visual Studio C++ Build Tools 2022 Download and install them from here: https://aka.ms/vs/17/release/vs_BuildTools.exe

If you have NVIDIA GPU, install CUDA:
Code:
choco install cuda -y

And check with the command:
Code:
nvidia-smi

If there is an error, it means you broke everything - deal with the drivers.

Step 2. Download Deep Live Cam​

Now let's clone the project:
Code:
git clone [URL]https://github.com/hacksider/Deep-Live-Cam.git[/URL]
cd Deep-Live-Cam

We install all dependencies:
Code:
pip install -r requirements.txt

If you have a GPU, add CUDA support:
Code:
pip install onnxruntime-gpu

Step 3. Downloading models​

Go to Hugging Face and download the files:

After that you can launch it!

Code:
python run.py --execution-provider CUDA

If there is no GPU:
Code:
python run.py

Step 4. Check and go to verification​

The program opens, we select a face and either upload a video or turn on the webcam. We press "Start" and get a decent fake.

Here's what you can do:
  • Change face in real time
  • Put yourself in any video
  • Make memes with cats (no, animals are not allowed yet)

Possible errors and solutions​

❌ python: command not found → Check if Python is added to PATH.
❌ CUDA is not found → Update NVIDIA drivers and run nvidia-smi.
❌ ModuleNotFoundError: No module named 'something' → Run pip install -r requirements.txt again.

That's it, now you're officially a master of face swapping!
 
Top