Compare commits

...

10 Commits

Author SHA1 Message Date
killerlux ba431490fc
Merge dd622d8837 into 2b70131e6a 2025-07-25 22:04:51 +09:00
Kenneth Estanislao 2b70131e6a
Update requirements.txt 2025-07-09 17:19:26 +08:00
Kenneth Estanislao fc86365a90 Delete .yml 2025-07-02 18:37:10 +08:00
Kenneth Estanislao 1dd0e8e509
Create .yml 2025-07-02 18:29:32 +08:00
Kenneth Estanislao 4e0ff540f0
Update requirements.txt
faster and better requirements
2025-07-02 04:08:26 +08:00
Kenneth Estanislao f0fae811d8
Update requirements.txt
should improve the performance by 30%
2025-06-29 15:03:35 +08:00
Kenneth Estanislao 42687f5bd9
Update README.md 2025-06-29 14:58:13 +08:00
Kenneth Estanislao 9086072b8e
Update README.md 2025-06-23 17:06:34 +08:00
Aymen Kouskoussi dd622d8837 Add security policy, pull request template, and new issue templates (feature request, question) 2025-05-03 09:20:13 +02:00
Aymen Kouskoussi 02ecc245bd Fix: Improve Linux CPU execution and webcam handling. Update README. 2025-05-03 09:16:41 +02:00
8 changed files with 140 additions and 21 deletions

View File

@ -0,0 +1,17 @@
---
name: Feature Request
description: Suggest an idea for this project
labels: enhancement
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@ -0,0 +1,11 @@
---
name: Question
about: Ask a question or request support
labels: question
---
**Your question**
Please describe your question or what you need help with.
**Context**
Add any other context or details that might help us answer your question.

View File

@ -0,0 +1,22 @@
# Pull Request Template
Thank you for your contribution!
Please fill out the following checklist and provide all relevant information to help us review your pull request.
## Description
Please include a summary of the change and which issue is fixed (if any). Also describe your motivation and context.
Fixes #(issue)
## Checklist
- [ ] My code follows the project style and guidelines
- [ ] I have performed a self-review of my code
- [ ] I have tested the changes and they work as expected
- [ ] I have added tests that prove my fix is effective or that my feature works (if applicable)
- [ ] I have added necessary documentation (if appropriate)
## Additional Information
Please add any other information or screenshots that may help the reviewers.

11
.github/SECURITY.md vendored 100644
View File

@ -0,0 +1,11 @@
# Security Policy
## Reporting a Vulnerability
If you discover a security vulnerability, please report it by emailing the project maintainers at [your-email@example.com].
- Do **not** create a public issue for security vulnerabilities.
- Provide as much information as possible to help us understand and address the issue quickly.
- We will acknowledge your report within 3 business days and strive to resolve all security issues promptly.
Thank you for helping keep this project and its users safe!

View File

@ -36,7 +36,7 @@ Users are expected to use this software responsibly and legally. If using a real
##### This is the fastest build you can get if you have a discrete NVIDIA or AMD GPU or Mac Silicon, And you'll receive special priority support. ##### This is the fastest build you can get if you have a discrete NVIDIA or AMD GPU or Mac Silicon, And you'll receive special priority support.
###### 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. This will be 60 days ahead on 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 ## TLDR; Live Deepfake in just 3 Clicks
![easysteps](https://github.com/user-attachments/assets/af825228-852c-411b-b787-ffd9aac72fc6) ![easysteps](https://github.com/user-attachments/assets/af825228-852c-411b-b787-ffd9aac72fc6)
@ -98,7 +98,7 @@ Users are expected to use this software responsibly and legally. If using a real
## Installation (Manual) ## Installation (Manual)
**Please be aware that the installation requires technical skills and is not for beginners. Consider downloading the prebuilt version.** **Please be aware that the installation requires technical skills and is not for beginners. Consider downloading the quickstart version.**
<details> <details>
<summary>Click to see the process</summary> <summary>Click to see the process</summary>
@ -109,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** **1. Set up Your Platform**
- Python (3.10 recommended) - Python (3.11 recommended)
- pip - pip
- git - git
- [ffmpeg](https://www.youtube.com/watch?v=OlNWCpFdVMA) - ```iex (irm ffmpeg.tc.ht)``` - [ffmpeg](https://www.youtube.com/watch?v=OlNWCpFdVMA) - ```iex (irm ffmpeg.tc.ht)```
@ -148,19 +148,44 @@ source venv/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
``` ```
**For Linux (Debian/Ubuntu based):**
```bash
# Install system dependencies (if needed)
sudo apt-get update
sudo apt-get install python3-venv python3-pip ffmpeg git
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install Python dependencies
# (Important: Ensure you have CPU-only versions if not using GPU)
pip uninstall -y torch torchvision torchaudio onnxruntime*
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
# Install webcam utilities (optional but helpful for troubleshooting)
sudo apt-get install v4l-utils
# Ensure your user is in the 'video' group for webcam access
# (You might need to log out and log back in after adding)
sudo adduser $USER video
groups
```
**For macOS:** **For macOS:**
Apple Silicon (M1/M2/M3) requires specific setup: Apple Silicon (M1/M2/M3) requires specific setup:
```bash ```bash
# Install Python 3.10 (specific version is important) # Install Python 3.11 (specific version is important)
brew install python@3.10 brew install python@3.11
# Install tkinter package (required for the GUI) # Install tkinter package (required for the GUI)
brew install python-tk@3.10 brew install python-tk@3.10
# Create and activate virtual environment with Python 3.10 # Create and activate virtual environment with Python 3.11
python3.10 -m venv venv python3.11 -m venv venv
source venv/bin/activate source venv/bin/activate
# Install dependencies # Install dependencies
@ -181,7 +206,7 @@ source venv/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
``` ```
**Run:** If you don't have a GPU, you can run Deep-Live-Cam using `python run.py`. Note that initial execution will download models (~300MB). **Run:** If you don't have a GPU, you can run Deep-Live-Cam using `python run.py` or `python run.py --execution-provider cpu`. Note that initial execution will download models (~300MB). Performance will be very low (potentially < 1 FPS) without a compatible GPU.
### GPU Acceleration ### GPU Acceleration
@ -236,7 +261,7 @@ python3.10 run.py --execution-provider coreml
# Uninstall conflicting versions if needed # Uninstall conflicting versions if needed
brew uninstall --ignore-dependencies python@3.11 python@3.13 brew uninstall --ignore-dependencies python@3.11 python@3.13
# Keep only Python 3.10 # Keep only Python 3.11
brew cleanup brew cleanup
``` ```
@ -246,7 +271,7 @@ python3.10 run.py --execution-provider coreml
```bash ```bash
pip uninstall onnxruntime onnxruntime-coreml pip uninstall onnxruntime onnxruntime-coreml
pip install onnxruntime-coreml==1.13.1 pip install onnxruntime-coreml==1.21.0
``` ```
2. Usage: 2. Usage:
@ -261,7 +286,7 @@ python run.py --execution-provider coreml
```bash ```bash
pip uninstall onnxruntime onnxruntime-directml pip uninstall onnxruntime onnxruntime-directml
pip install onnxruntime-directml==1.15.1 pip install onnxruntime-directml==1.21.0
``` ```
2. Usage: 2. Usage:
@ -276,7 +301,7 @@ python run.py --execution-provider directml
```bash ```bash
pip uninstall onnxruntime onnxruntime-openvino pip uninstall onnxruntime onnxruntime-openvino
pip install onnxruntime-openvino==1.15.0 pip install onnxruntime-openvino==1.21.0
``` ```
2. Usage: 2. Usage:

View File

@ -4,7 +4,11 @@ import sys
if any(arg.startswith('--execution-provider') for arg in sys.argv): if any(arg.startswith('--execution-provider') for arg in sys.argv):
os.environ['OMP_NUM_THREADS'] = '1' os.environ['OMP_NUM_THREADS'] = '1'
# reduce tensorflow log level # reduce tensorflow log level
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
# disable GPU for tensorflow when using CPU provider
if '--execution-provider' in sys.argv and 'cpu' in sys.argv[sys.argv.index('--execution-provider') + 1]:
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import warnings import warnings
from typing import List from typing import List
import platform import platform
@ -81,6 +85,13 @@ def parse_args() -> None:
modules.globals.execution_threads = args.execution_threads modules.globals.execution_threads = args.execution_threads
modules.globals.lang = args.lang modules.globals.lang = args.lang
# If using CPU provider, ensure we're not using any GPU features
if 'cpu' in args.execution_provider:
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
if torch.cuda.is_available():
torch.cuda.empty_cache()
torch.cuda.set_device('cpu')
#for ENHANCER tumbler: #for ENHANCER tumbler:
if 'face_enhancer' in args.frame_processor: if 'face_enhancer' in args.frame_processor:
modules.globals.fp_ui['face_enhancer'] = True modules.globals.fp_ui['face_enhancer'] = True

View File

@ -42,15 +42,31 @@ class VideoCapturer:
for dev_id, backend in capture_methods: for dev_id, backend in capture_methods:
try: try:
print(f"Trying device {dev_id} with backend {backend}")
self.cap = cv2.VideoCapture(dev_id, backend) self.cap = cv2.VideoCapture(dev_id, backend)
if self.cap.isOpened(): if self.cap.isOpened():
print(f"Successfully opened device {dev_id} with backend {backend}")
break break
self.cap.release() self.cap.release()
except Exception: except Exception as e:
print(f"Failed to open device {dev_id} with backend {backend}: {str(e)}")
continue continue
else: else:
# Unix-like systems (Linux/Mac) capture method # Unix-like systems (Linux/Mac) capture method
self.cap = cv2.VideoCapture(self.device_index) # Try device 0 first, then the specified device index if different
capture_methods = [(0, cv2.CAP_V4L2), (self.device_index, cv2.CAP_V4L2)] if self.device_index != 0 else [(0, cv2.CAP_V4L2)]
for dev_id, backend in capture_methods:
try:
print(f"Trying device {dev_id} with backend {backend}")
self.cap = cv2.VideoCapture(dev_id, backend)
if self.cap.isOpened():
print(f"Successfully opened device {dev_id} with backend {backend}")
break
self.cap.release()
except Exception as e:
print(f"Failed to open device {dev_id} with backend {backend}: {str(e)}")
continue
if not self.cap or not self.cap.isOpened(): if not self.cap or not self.cap.isOpened():
raise RuntimeError("Failed to open camera") raise RuntimeError("Failed to open camera")
@ -60,6 +76,12 @@ class VideoCapturer:
self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height) self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
self.cap.set(cv2.CAP_PROP_FPS, fps) self.cap.set(cv2.CAP_PROP_FPS, fps)
# Print actual camera settings
actual_width = self.cap.get(cv2.CAP_PROP_FRAME_WIDTH)
actual_height = self.cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
actual_fps = self.cap.get(cv2.CAP_PROP_FPS)
print(f"Camera initialized with: {actual_width}x{actual_height} @ {actual_fps}fps")
self.is_running = True self.is_running = True
return True return True

View File

@ -1,21 +1,21 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu128
numpy>=1.23.5,<2 numpy>=1.23.5,<2
typing-extensions>=4.8.0 typing-extensions>=4.8.0
opencv-python==4.10.0.84 opencv-python==4.10.0.84
cv2_enumerate_cameras==1.1.15 cv2_enumerate_cameras==1.1.15
onnx==1.16.0 onnx==1.18.0
insightface==0.7.3 insightface==0.7.3
psutil==5.9.8 psutil==5.9.8
tk==0.1.0 tk==0.1.0
customtkinter==5.2.2 customtkinter==5.2.2
pillow==11.1.0 pillow==11.1.0
torch==2.5.1+cu118; sys_platform != 'darwin' torch; sys_platform != 'darwin'
torch==2.5.1; sys_platform == 'darwin' torch==2.5.1; sys_platform == 'darwin'
torchvision==0.20.1; sys_platform != 'darwin' torchvision; sys_platform != 'darwin'
torchvision==0.20.1; sys_platform == 'darwin' torchvision==0.20.1; sys_platform == 'darwin'
onnxruntime-silicon==1.16.3; sys_platform == 'darwin' and platform_machine == 'arm64' onnxruntime-silicon==1.16.3; sys_platform == 'darwin' and platform_machine == 'arm64'
onnxruntime-gpu==1.17; sys_platform != 'darwin' onnxruntime-gpu==1.22.0; sys_platform != 'darwin'
tensorflow; sys_platform != 'darwin' tensorflow; sys_platform != 'darwin'
opennsfw2==0.10.2 opennsfw2==0.10.2
protobuf==4.23.2 protobuf==4.25.1