Compare commits
13 Commits
e59fb64b4e
...
11d2a533e5
| Author | SHA1 | Date |
|---|---|---|
|
|
11d2a533e5 | |
|
|
745d449ca6 | |
|
|
ec6d7d2995 | |
|
|
e791f2f18a | |
|
|
3795e41fd7 | |
|
|
ab8a1c82c1 | |
|
|
e1842ae0ba | |
|
|
989106e914 | |
|
|
de27fb8a81 | |
|
|
28109e93bb | |
|
|
fc312516e3 | |
|
|
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!
|
||||
35
README.md
35
README.md
|
|
@ -148,6 +148,31 @@ source venv/bin/activate
|
|||
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:**
|
||||
|
||||
Apple Silicon (M1/M2/M3) requires specific setup:
|
||||
|
|
@ -181,16 +206,20 @@ source venv/bin/activate
|
|||
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
|
||||
|
||||
**CUDA Execution Provider (Nvidia)**
|
||||
|
||||
1. Install [CUDA Toolkit 11.8.0](https://developer.nvidia.com/cuda-11-8-0-download-archive)
|
||||
2. Install dependencies:
|
||||
1. Install [CUDA Toolkit 12.8.0](https://developer.nvidia.com/cuda-12-8-0-download-archive)
|
||||
2. Install [cuDNN v8.9.7 for CUDA 12.x](https://developer.nvidia.com/rdp/cudnn-archive) (required for onnxruntime-gpu):
|
||||
- Download cuDNN v8.9.7 for CUDA 12.x
|
||||
- Make sure the cuDNN bin directory is in your system PATH
|
||||
3. Install dependencies:
|
||||
|
||||
```bash
|
||||
pip install -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
|
||||
pip uninstall onnxruntime onnxruntime-gpu
|
||||
pip install onnxruntime-gpu==1.16.3
|
||||
```
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"Source x Target Mapper": "Mapeador de fuente x destino",
|
||||
"select a source image": "Seleccionar imagen fuente",
|
||||
"Preview": "Vista previa",
|
||||
"select a target image or video": "elegir un video o una imagen fuente",
|
||||
"save image output file": "guardar imagen final",
|
||||
"save video output file": "guardar video final",
|
||||
"select a target image": "elegir una imagen objetiva",
|
||||
"source": "fuente",
|
||||
"Select a target": "Elegir un destino",
|
||||
"Select a face": "Elegir una cara",
|
||||
"Keep audio": "Mantener audio original",
|
||||
"Face Enhancer": "Potenciador de caras",
|
||||
"Many faces": "Varias caras",
|
||||
"Show FPS": "Mostrar fps",
|
||||
"Keep fps": "Mantener fps",
|
||||
"Keep frames": "Mantener frames",
|
||||
"Fix Blueish Cam": "Corregir tono azul de video",
|
||||
"Mouth Mask": "Máscara de boca",
|
||||
"Show Mouth Mask Box": "Mostrar área de la máscara de boca",
|
||||
"Start": "Iniciar",
|
||||
"Live": "En vivo",
|
||||
"Destroy": "Borrar",
|
||||
"Map faces": "Mapear caras",
|
||||
"Processing...": "Procesando...",
|
||||
"Processing succeed!": "¡Proceso terminado con éxito!",
|
||||
"Processing ignored!": "¡Procesamiento omitido!",
|
||||
"Failed to start camera": "No se pudo iniciar la cámara",
|
||||
"Please complete pop-up or close it.": "Complete o cierre el pop-up",
|
||||
"Getting unique faces": "Buscando caras únicas",
|
||||
"Please select a source image first": "Primero, seleccione una imagen fuente",
|
||||
"No faces found in target": "No se encontró una cara en el destino",
|
||||
"Add": "Agregar",
|
||||
"Clear": "Limpiar",
|
||||
"Submit": "Enviar",
|
||||
"Select source image": "Seleccionar imagen fuente",
|
||||
"Select target image": "Seleccionar imagen destino",
|
||||
"Please provide mapping!": "Por favor, proporcione un mapeo",
|
||||
"At least 1 source with target is required!": "Se requiere al menos una fuente con un destino.",
|
||||
"At least 1 source with target is required!": "Se requiere al menos una fuente con un destino.",
|
||||
"Face could not be detected in last upload!": "¡No se pudo encontrar una cara en el último video o imagen!",
|
||||
"Select Camera:": "Elegir cámara:",
|
||||
"All mappings cleared!": "¡Todos los mapeos fueron borrados!",
|
||||
"Mappings successfully submitted!": "Mapeos enviados con éxito!",
|
||||
"Source x Target Mapper is already open.": "El mapeador de fuente x destino ya está abierto."
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"Source x Target Mapper": "소스 x 타겟 매퍼",
|
||||
"select a source image": "소스 이미지 선택",
|
||||
"Preview": "미리보기",
|
||||
"select a target image or video": "타겟 이미지 또는 영상 선택",
|
||||
"save image output file": "이미지 출력 파일 저장",
|
||||
"save video output file": "영상 출력 파일 저장",
|
||||
"select a target image": "타겟 이미지 선택",
|
||||
"source": "소스",
|
||||
"Select a target": "타겟 선택",
|
||||
"Select a face": "얼굴 선택",
|
||||
"Keep audio": "오디오 유지",
|
||||
"Face Enhancer": "얼굴 향상",
|
||||
"Many faces": "여러 얼굴",
|
||||
"Show FPS": "FPS 표시",
|
||||
"Keep fps": "FPS 유지",
|
||||
"Keep frames": "프레임 유지",
|
||||
"Fix Blueish Cam": "푸른빛 카메라 보정",
|
||||
"Mouth Mask": "입 마스크",
|
||||
"Show Mouth Mask Box": "입 마스크 박스 표시",
|
||||
"Start": "시작",
|
||||
"Live": "라이브",
|
||||
"Destroy": "종료",
|
||||
"Map faces": "얼굴 매핑",
|
||||
"Processing...": "처리 중...",
|
||||
"Processing succeed!": "처리 성공!",
|
||||
"Processing ignored!": "처리 무시됨!",
|
||||
"Failed to start camera": "카메라 시작 실패",
|
||||
"Please complete pop-up or close it.": "팝업을 완료하거나 닫아주세요.",
|
||||
"Getting unique faces": "고유 얼굴 가져오는 중",
|
||||
"Please select a source image first": "먼저 소스 이미지를 선택해주세요",
|
||||
"No faces found in target": "타겟에서 얼굴을 찾을 수 없음",
|
||||
"Add": "추가",
|
||||
"Clear": "지우기",
|
||||
"Submit": "제출",
|
||||
"Select source image": "소스 이미지 선택",
|
||||
"Select target image": "타겟 이미지 선택",
|
||||
"Please provide mapping!": "매핑을 입력해주세요!",
|
||||
"At least 1 source with target is required!": "최소 하나의 소스와 타겟이 필요합니다!",
|
||||
"Face could not be detected in last upload!": "최근 업로드에서 얼굴을 감지할 수 없습니다!",
|
||||
"Select Camera:": "카메라 선택:",
|
||||
"All mappings cleared!": "모든 매핑이 삭제되었습니다!",
|
||||
"Mappings successfully submitted!": "매핑이 성공적으로 제출되었습니다!",
|
||||
"Source x Target Mapper is already open.": "소스 x 타겟 매퍼가 이미 열려 있습니다."
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"Source x Target Mapper": "Сопоставитель Источник x Цель",
|
||||
"select a source image": "выберите исходное изображение",
|
||||
"Preview": "Предпросмотр",
|
||||
"select a target image or video": "выберите целевое изображение или видео",
|
||||
"save image output file": "сохранить выходной файл изображения",
|
||||
"save video output file": "сохранить выходной файл видео",
|
||||
"select a target image": "выберите целевое изображение",
|
||||
"source": "источник",
|
||||
"Select a target": "Выберите целевое изображение",
|
||||
"Select a face": "Выберите лицо",
|
||||
"Keep audio": "Сохранить аудио",
|
||||
"Face Enhancer": "Улучшение лица",
|
||||
"Many faces": "Несколько лиц",
|
||||
"Show FPS": "Показать FPS",
|
||||
"Keep fps": "Сохранить FPS",
|
||||
"Keep frames": "Сохранить кадры",
|
||||
"Fix Blueish Cam": "Исправить синеву камеры",
|
||||
"Mouth Mask": "Маска рта",
|
||||
"Show Mouth Mask Box": "Показать рамку маски рта",
|
||||
"Start": "Старт",
|
||||
"Live": "В реальном времени",
|
||||
"Destroy": "Остановить",
|
||||
"Map faces": "Сопоставить лица",
|
||||
"Processing...": "Обработка...",
|
||||
"Processing succeed!": "Обработка успешна!",
|
||||
"Processing ignored!": "Обработка проигнорирована!",
|
||||
"Failed to start camera": "Не удалось запустить камеру",
|
||||
"Please complete pop-up or close it.": "Пожалуйста, заполните всплывающее окно или закройте его.",
|
||||
"Getting unique faces": "Получение уникальных лиц",
|
||||
"Please select a source image first": "Сначала выберите исходное изображение, пожалуйста",
|
||||
"No faces found in target": "В целевом изображении не найдено лиц",
|
||||
"Add": "Добавить",
|
||||
"Clear": "Очистить",
|
||||
"Submit": "Отправить",
|
||||
"Select source image": "Выбрать исходное изображение",
|
||||
"Select target image": "Выбрать целевое изображение",
|
||||
"Please provide mapping!": "Пожалуйста, укажите сопоставление!",
|
||||
"At least 1 source with target is required!": "Требуется хотя бы 1 источник с целью!",
|
||||
"Face could not be detected in last upload!": "Лицо не обнаружено в последнем загруженном изображении!",
|
||||
"Select Camera:": "Выберите камеру:",
|
||||
"All mappings cleared!": "Все сопоставления очищены!",
|
||||
"Mappings successfully submitted!": "Сопоставления успешно отправлены!",
|
||||
"Source x Target Mapper is already open.": "Сопоставитель Источник-Цель уже открыт."
|
||||
}
|
||||
|
|
@ -4,7 +4,11 @@ import sys
|
|||
if any(arg.startswith('--execution-provider') for arg in sys.argv):
|
||||
os.environ['OMP_NUM_THREADS'] = '1'
|
||||
# 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
|
||||
from typing import List
|
||||
import platform
|
||||
|
|
@ -81,6 +85,13 @@ def parse_args() -> None:
|
|||
modules.globals.execution_threads = args.execution_threads
|
||||
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:
|
||||
if 'face_enhancer' in args.frame_processor:
|
||||
modules.globals.fp_ui['face_enhancer'] = True
|
||||
|
|
|
|||
|
|
@ -42,15 +42,31 @@ class VideoCapturer:
|
|||
|
||||
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:
|
||||
except Exception as e:
|
||||
print(f"Failed to open device {dev_id} with backend {backend}: {str(e)}")
|
||||
continue
|
||||
else:
|
||||
# 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():
|
||||
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_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
|
||||
return True
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue