Compare commits
4 Commits
a8a002f4ea
...
66020d8cb7
Author | SHA1 | Date |
---|---|---|
|
66020d8cb7 | |
|
4a7874a968 | |
|
dd622d8837 | |
|
02ecc245bd |
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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!
|
27
README.md
27
README.md
|
@ -148,6 +148,31 @@ 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:
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"Source x Target Mapper": "Source x Target Kartoitin",
|
||||||
|
"select an source image": "Valitse lähde kuva",
|
||||||
|
"Preview": "Esikatsele",
|
||||||
|
"select an target image or video": "Valitse kohde kuva tai video",
|
||||||
|
"save image output file": "tallenna kuva",
|
||||||
|
"save video output file": "tallenna video",
|
||||||
|
"select an target image": "Valitse kohde kuva",
|
||||||
|
"source": "lähde",
|
||||||
|
"Select a target": "Valitse kohde",
|
||||||
|
"Select a face": "Valitse kasvot",
|
||||||
|
"Keep audio": "Säilytä ääni",
|
||||||
|
"Face Enhancer": "Kasvojen Parantaja",
|
||||||
|
"Many faces": "Useampia kasvoja",
|
||||||
|
"Show FPS": "Näytä FPS",
|
||||||
|
"Keep fps": "Säilytä FPS",
|
||||||
|
"Keep frames": "Säilytä ruudut",
|
||||||
|
"Fix Blueish Cam": "Korjaa Sinertävä Kamera",
|
||||||
|
"Mouth Mask": "Suu Maski",
|
||||||
|
"Show Mouth Mask Box": "Näytä Suu Maski Laatiko",
|
||||||
|
"Start": "Aloita",
|
||||||
|
"Live": "Live",
|
||||||
|
"Destroy": "Tuhoa",
|
||||||
|
"Map faces": "Kartoita kasvot",
|
||||||
|
"Processing...": "Prosessoi...",
|
||||||
|
"Processing succeed!": "Prosessointi onnistui!",
|
||||||
|
"Processing ignored!": "Prosessointi lopetettu!",
|
||||||
|
"Failed to start camera": "Kameran käynnistäminen epäonnistui",
|
||||||
|
"Please complete pop-up or close it.": "Viimeistele tai sulje ponnahdusikkuna",
|
||||||
|
"Getting unique faces": "Hankitaan uniikkeja kasvoja",
|
||||||
|
"Please select a source image first": "Valitse ensin lähde kuva",
|
||||||
|
"No faces found in target": "Kasvoja ei löydetty kohteessa",
|
||||||
|
"Add": "Lisää",
|
||||||
|
"Clear": "Tyhjennä",
|
||||||
|
"Submit": "Lähetä",
|
||||||
|
"Select source image": "Valitse lähde kuva",
|
||||||
|
"Select target image": "Valitse kohde kuva",
|
||||||
|
"Please provide mapping!": "Tarjoa kartoitus!",
|
||||||
|
"Atleast 1 source with target is required!": "Vähintään 1 lähde kohteen kanssa on vaadittu!",
|
||||||
|
"At least 1 source with target is required!": "Vähintään 1 lähde kohteen kanssa on vaadittu!",
|
||||||
|
"Face could not be detected in last upload!": "Kasvoja ei voitu tunnistaa edellisessä latauksessa!",
|
||||||
|
"Select Camera:": "Valitse Kamera:",
|
||||||
|
"All mappings cleared!": "Kaikki kartoitukset tyhjennetty!",
|
||||||
|
"Mappings successfully submitted!": "Kartoitukset lähetety onnistuneesti!",
|
||||||
|
"Source x Target Mapper is already open.": "Lähde x Kohde Kartoittaja on jo auki."
|
||||||
|
}
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue