Compare commits

..
Author SHA1 Message Date
Kenneth EstanislaoandClaude Opus 4.8 c54c8f3105 Bump onnx, pillow, protobuf to resolve Dependabot alerts
Resolves all 13 open Dependabot advisories (8 high, 5 moderate):

- onnx 1.18.0 -> 1.21.0  (6: GHSA-3r9x-f23j-gc73, GHSA-538c-55jv-c5g9,
  GHSA-hqmj-h5c6-369m, GHSA-q56x-g2fj-4rj6, GHSA-cmw6-hcpp-c6jp,
  GHSA-p433-9wv8-28xj)
- pillow 12.1.1 -> 12.2.0  (5: GHSA-pwv6-vv43-88gr, GHSA-whj4-6x5x-4v2j,
  GHSA-5xmw-vc9v-4wf2, GHSA-r73j-pqj5-w3x7, GHSA-wjx4-4jcj-g98j)
- protobuf 4.25.1 -> 5.29.6  (2: GHSA-8qvm-5x2c-j2w7, GHSA-7gcm-g887-7qv7;
  the recursion-depth fix has no 4.x release, so 5.x is required)

protobuf 5.x caps tensorflow at 2.20.0 (2.21 needs protobuf>=6.31.1), which
keeps numpy at 1.26.x, preserving the existing numpy<2 pin. Verified with a
pip dry-run resolve and re-scanned the resulting set against OSV (all clean).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 23:04:25 +08:00
11 changed files with 44 additions and 157 deletions
+25 -54
View File
@@ -30,39 +30,13 @@ By using this software, you agree to these terms and commit to using it in a man
Users are expected to use this software responsibly and legally. If using a real person's face, obtain their consent and clearly label any output as a deepfake when sharing online. We are not responsible for end-user actions.
## Pre-built Quickstart
## Exclusive v2.7 RC2 Quick Start - Pre-built (Windows/Mac Silicon/CPU)
<p align="center">
<a href="https://deeplivecam.net/index.php/quickstart">
<img src="https://github.com/user-attachments/assets/fa2cdf79-c933-4b93-844a-b087192261ed" width="100%" alt="Lite / Ultimate Download Banner">
</a>
</p>
<a href="https://deeplivecam.net/index.php/quickstart"> <img src="media/Download.png" width="285" height="77" />
<p align="center">
<img src="https://github.com/user-attachments/assets/56b61811-3a1e-4672-9b50-cf7f6e8e6852" width="40" alt="Windows">
&nbsp;&nbsp;&nbsp;
<img src="https://github.com/user-attachments/assets/6538e3a6-c957-431a-b586-2d6abcf534dc" width="34" alt="Mac Silicon">
&nbsp;&nbsp;&nbsp;
<img src="https://github.com/user-attachments/assets/ad45142e-426c-4364-a2a9-a512670cc62c" width="40" alt="CPU">
</p>
<p align="center">
<strong>Windows • Mac Silicon • CPU • NVIDIA • AMD</strong>
</p>
<p align="center">
Builds optimized for your hardware.
</p>
<p align="center">
<a href="https://deeplivecam.net/index.php/quickstart">
<img src="media/Download.png" width="280" alt="Download">
</a>
</p>
> **Ultimate** includes **30+ exclusive features**, performance optimizations, and **priority support**.
Perfect if you want the fastest setup with **zero manual installation**, pre-configured dependencies, and optimized builds for every supported platform.
##### This is the fastest build you can get if you have a discrete NVIDIA or AMD GPU, CPU or Mac Silicon, And you'll receive special priority support. 2.7 beta is the best you can have with 30+ extra features than the open source version.
###### These Pre-builts are perfect for non-technical users or those who don't have time to, or can't manually install all the requirements. Just a heads-up: this is an open-source project, so you can also install it manually.
## TLDR; Live Deepfake in just 3 Clicks
![easysteps](https://github.com/user-attachments/assets/af825228-852c-411b-b787-ffd9aac72fc6)
@@ -135,7 +109,7 @@ This is more likely to work on your computer but will be slower as it utilizes t
**1. Set up Your Platform**
- Python (3.14 recommended; 3.11-3.14 supported)
- Python (3.11 recommended)
- pip
- git
- [ffmpeg](https://www.youtube.com/watch?v=OlNWCpFdVMA) - ```iex (irm ffmpeg.tc.ht)```
@@ -144,7 +118,7 @@ This is more likely to work on your computer but will be slower as it utilizes t
**2. Clone the Repository**
```bash
git clone --depth 1 https://github.com/hacksider/Deep-Live-Cam.git
git clone https://github.com/hacksider/Deep-Live-Cam.git
cd Deep-Live-Cam
```
@@ -168,7 +142,7 @@ pip install -r requirements.txt
```
For Linux:
```bash
# Ensure you use the installed Python 3.14
# Ensure you use the installed Python 3.11
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
@@ -176,17 +150,17 @@ pip install -r requirements.txt
**For macOS:**
Apple Silicon (M1 through M5) requires specific setup:
Apple Silicon (M1/M2/M3) requires specific setup:
```bash
# Install Python 3.14
brew install python@3.14
# Install Python 3.11 (specific version is important)
brew install python@3.11
# Install tkinter package (required for the GUI)
brew install python-tk@3.14
brew install python-tk@3.11
# Create and activate virtual environment with Python 3.14
python3.14 -m venv venv
# Create and activate virtual environment with Python 3.11
python3.11 -m venv venv
source venv/bin/activate
# Install dependencies
@@ -238,29 +212,26 @@ python run.py --execution-provider cuda
**CoreML Execution Provider (Apple Silicon)**
Apple Silicon (M1 through M5) specific installation:
Apple Silicon (M1/M2/M3) specific installation:
1. Make sure you've completed the macOS setup above using Python 3.14.
2. No extra install step is needed — `requirements.txt` pulls the official
`onnxruntime` build, whose macOS wheels ship the CoreML execution provider.
If you previously installed the unmaintained `onnxruntime-silicon` fork,
remove it first, as it shadows the real package:
1. Make sure you've completed the macOS setup above using Python 3.11.
2. Install dependencies:
```bash
pip uninstall onnxruntime-silicon
pip install -r requirements.txt
pip uninstall onnxruntime onnxruntime-silicon
pip install onnxruntime-silicon==1.13.1
```
3. Usage:
```bash
python3.14 run.py --execution-provider coreml
python3.11 run.py --execution-provider coreml
```
**Important Notes for macOS:**
- Python 3.11 is the minimum (onnxruntime dropped 3.10); 3.14 is recommended
- Always run with `python3.14` command not just `python` if you have multiple Python versions installed
- If you get error about `_tkinter` missing, reinstall the tkinter package: `brew reinstall python-tk@3.14`
- You **must** use Python 3.11, not newer versions like 3.13
- Always run with `python3.11` command not just `python` if you have multiple Python versions installed
- If you get error about `_tkinter` missing, reinstall the tkinter package: `brew reinstall python-tk@3.11`
- If you get model loading errors, check that your models are in the correct folder
- If you encounter conflicts with other Python versions, consider uninstalling them:
```bash
@@ -268,9 +239,9 @@ python3.14 run.py --execution-provider coreml
brew list | grep python
# Uninstall conflicting versions if needed
brew uninstall --ignore-dependencies python@3.11
brew uninstall --ignore-dependencies python@3.13
# Keep only Python 3.14
# Keep only Python 3.11
brew cleanup
```
+2 -7
View File
@@ -14,13 +14,8 @@ def get_video_frame(video_path: str, frame_number: int = 0) -> Any:
if modules.globals.color_correction:
capture.set(cv2.CAP_PROP_CONVERT_RGB, 1)
frame_total = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
if frame_total <= 0:
capture.release()
return None
target_index = 0 if frame_number <= 1 else min(frame_total - 1, frame_number - 1)
capture.set(cv2.CAP_PROP_POS_FRAMES, target_index)
frame_total = capture.get(cv2.CAP_PROP_FRAME_COUNT)
capture.set(cv2.CAP_PROP_POS_FRAMES, min(frame_total, frame_number - 1))
has_frame, frame = capture.read()
if has_frame and modules.globals.color_correction:
-12
View File
@@ -4,18 +4,6 @@ from typing import Any
def find_cluster_centroids(embeddings, max_k=10) -> Any:
n_samples = len(embeddings)
if n_samples == 0:
raise ValueError("embeddings must not be empty")
if max_k < 1:
raise ValueError("max_k must be at least 1")
max_k = min(max_k, n_samples)
if max_k == 1:
kmeans = KMeans(n_clusters=1, random_state=0)
kmeans.fit(embeddings)
return kmeans.cluster_centers_
inertia = []
cluster_centroids = []
K = range(1, max_k+1)
+3 -11
View File
@@ -58,7 +58,7 @@ def parse_args() -> None:
program.add_argument('--live-resizable', help='The live camera frame is resizable', dest='live_resizable', action='store_true', default=False)
program.add_argument('--max-memory', help='maximum amount of RAM in GB', dest='max_memory', type=int, default=suggest_max_memory())
program.add_argument('--execution-provider', help='execution provider', dest='execution_provider', default=[suggest_default_execution_provider()], choices=suggest_execution_providers(), nargs='+')
program.add_argument('--execution-threads', help='number of execution threads', dest='execution_threads', type=int, default=None)
program.add_argument('--execution-threads', help='number of execution threads', dest='execution_threads', type=int, default=suggest_execution_threads())
program.add_argument('-v', '--version', action='version', version=f'{modules.metadata.name} {modules.metadata.version}')
# register deprecated args
@@ -90,12 +90,6 @@ def parse_args() -> None:
modules.globals.execution_threads = args.execution_threads
modules.globals.lang = args.lang
# The argparse default (None) avoids evaluating suggest_execution_threads()
# before providers are decoded, and deprecated-arg overrides above may
# have already set execution_threads.
if modules.globals.execution_threads is None:
modules.globals.execution_threads = suggest_execution_threads()
#for ENHANCER tumblers:
for enhancer_key in ('face_enhancer', 'face_enhancer_gpen256', 'face_enhancer_gpen512'):
modules.globals.fp_ui[enhancer_key] = enhancer_key in args.frame_processor
@@ -138,9 +132,9 @@ def suggest_max_memory() -> int:
def suggest_default_execution_provider() -> str:
"""Pick the best available provider: cuda > rocm > coreml > openvino > dml > cpu."""
"""Pick the best available provider: cuda > rocm > coreml > dml > cpu."""
available = encode_execution_providers(onnxruntime.get_available_providers())
for pref in ('cuda', 'rocm', 'coreml', 'openvino', 'dml'):
for pref in ('cuda', 'rocm', 'coreml', 'dml'):
if pref in available:
return pref
return 'cpu'
@@ -163,8 +157,6 @@ def suggest_execution_threads() -> int:
return 1
if 'CUDAExecutionProvider' in modules.globals.execution_providers:
return 2
if 'OpenVINOExecutionProvider' in modules.globals.execution_providers:
return 1
# For CPU execution, use most cores but leave some for system
return max(4, min(cpu_count - 2, 16))
-3
View File
@@ -335,9 +335,6 @@ def default_target_face():
best_frame = frame
break
if best_face is None:
continue # No faces detected in this cluster — skip
for frame in map['target_faces_in_frame']:
for face in frame['faces']:
if face['det_score'] > best_face['det_score']:
-11
View File
@@ -40,15 +40,6 @@ ONNX_PROVIDERS: List[str] = _detect_onnx_providers()
HAS_CUDA_PROVIDER: bool = "CUDAExecutionProvider" in ONNX_PROVIDERS
HAS_COREML_PROVIDER: bool = "CoreMLExecutionProvider" in ONNX_PROVIDERS
HAS_DML_PROVIDER: bool = "DmlExecutionProvider" in ONNX_PROVIDERS
HAS_OPENVINO_PROVIDER: bool = "OpenVINOExecutionProvider" in ONNX_PROVIDERS
# OpenVINO execution-provider config shared by every ONNX session builder.
# AUTO:GPU,NPU,CPU lets OpenVINO pick the best available device in priority
# order (Intel GPU → NPU → CPU).
OPENVINO_PROVIDER_CONFIG = (
"OpenVINOExecutionProvider",
{"device_type": "AUTO:GPU,NPU,CPU"},
)
def camera_backends() -> List[Tuple[int, int]]:
@@ -74,8 +65,6 @@ def accelerator_label() -> str:
return "CoreML (Apple Neural Engine)"
if HAS_COREML_PROVIDER:
return "CoreML"
if HAS_OPENVINO_PROVIDER:
return "OpenVINO (Intel)"
if HAS_DML_PROVIDER:
return "DirectML"
return "CPU"
-13
View File
@@ -1,17 +1,4 @@
import importlib.util
import os
import numpy
# Keras 3 defaults to the TensorFlow backend, which has no Python 3.14 wheels.
# opennsfw2 only runs inference, so any installed backend works; pick one that
# is actually present before opennsfw2 imports keras.
if "KERAS_BACKEND" not in os.environ:
for _backend in ("torch", "tensorflow", "jax"):
if importlib.util.find_spec(_backend) is not None:
os.environ["KERAS_BACKEND"] = _backend
break
import opennsfw2
from PIL import Image
import cv2 # Add OpenCV import
@@ -14,7 +14,6 @@ import numpy as np
import onnxruntime
import modules.globals
from modules.platform_info import OPENVINO_PROVIDER_CONFIG
IS_APPLE_SILICON = platform.system() == "Darwin" and platform.machine() == "arm64"
@@ -51,9 +50,6 @@ def build_provider_config(providers=None):
"AllowLowPrecisionAccumulationOnGPU": 1,
},
))
elif p == "OpenVINOExecutionProvider":
# AUTO lets OpenVINO select the best device
config.append(OPENVINO_PROVIDER_CONFIG)
else:
config.append(p)
return config
-3
View File
@@ -18,7 +18,6 @@ from modules.utilities import (
)
from modules.cluster_analysis import find_closest_centroid
from modules.gpu_processing import gpu_gaussian_blur, gpu_sharpen, gpu_add_weighted, gpu_resize
from modules.platform_info import OPENVINO_PROVIDER_CONFIG
import os
from collections import deque
import time
@@ -271,8 +270,6 @@ def get_face_swapper() -> Any:
# Use bare provider — ONNX Runtime defaults are
# fastest on modern GPUs (Blackwell/sm_120).
providers_config.append(p)
elif p == "OpenVINOExecutionProvider":
providers_config.append(OPENVINO_PROVIDER_CONFIG)
else:
providers_config.append(p)
FACE_SWAPPER = insightface.model_zoo.get_model(
+14 -15
View File
@@ -1,18 +1,17 @@
numpy>=2.0,<3
typing-extensions>=4.15.0
opencv-python==4.14.0.94
opencv-python-headless==4.14.0.94
cv2_enumerate_cameras==1.3.3
onnx==1.22.0
numpy>=1.23.5,<2
typing-extensions>=4.8.0
opencv-python==4.10.0.84
cv2_enumerate_cameras==1.1.15
onnx==1.21.0
insightface==0.7.3
psutil==7.2.2
psutil==5.9.8
PySide6>=6.7,<7
pillow==12.3.0
tqdm>=4.66.3
onnxruntime==1.28.0; sys_platform == 'darwin' and platform_machine == 'arm64'
onnxruntime==1.23.0; sys_platform == 'darwin' and platform_machine != 'arm64'
onnxruntime-gpu==1.26.0; sys_platform != 'darwin'
opennsfw2==0.18.0
keras>=3.0.0
protobuf>=6.33.5,<8
pillow==12.2.0
tqdm>=4.65.0
onnxruntime-silicon==1.16.3; sys_platform == 'darwin' and platform_machine == 'arm64'
onnxruntime-gpu==1.23.2; sys_platform != 'darwin'
tensorflow>=2.15.0; sys_platform != 'darwin'
tensorflow>=2.15.0; sys_platform == 'darwin' and python_version < '3.13'
opennsfw2==0.10.2
protobuf==5.29.6
pygrabber; sys_platform == 'win32'
-24
View File
@@ -31,30 +31,6 @@ if sys.platform == "win32":
except (OSError, AttributeError):
pass
# On Windows, register OpenVINO DLL directories so onnxruntime's
# OpenVINOExecutionProvider can find openvino.dll. This must happen
# before any ONNX InferenceSession is created. Failure is non-fatal:
# OpenVINO simply isn't installed, and onnxruntime will fall back to CPU.
try:
from onnxruntime.tools.add_openvino_win_libs import ( # type: ignore[import-untyped] # noqa: E501
add_openvino_libs_to_path,
)
add_openvino_libs_to_path()
except ImportError:
# onnxruntime build without the OpenVINO tooling module — no-op.
pass
except FileNotFoundError:
# OpenVINO site-packages dir absent — no-op.
pass
except SystemExit as exc:
# add_openvino_libs_to_path() calls sys.exit() when OpenVINO libs
# can't be located (e.g. OPENVINO_LIB_PATHS unset). Log the message
# it raised with so the failure is visible, but keep startup alive.
print(
f"[startup] OpenVINO DLL registration skipped: {exc}",
flush=True,
)
# On Linux, pre-load NVIDIA shared libraries (cuDNN, cuBLAS, nvrtc...) shipped
# inside the venv via pip wheels (nvidia-cudnn-cu12, etc.). LD_LIBRARY_PATH
# cannot be set after Python starts, so we use ctypes.CDLL with RTLD_GLOBAL