Skip to content

Commit 9e54465

Browse files
committed
2 parents b9c7c0d + cab8b9a commit 9e54465

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
[Remove this]The issue would most likely be diagnosed if you follow the template and give all the info.
1+
***[Remove this]The issue would be closed without notice and be considered spam if the template is not followed.***
22

33
**Describe the bug**
44
A clear and concise description of what the bug is.
55

6-
**To Reproduce**
7-
Steps to reproduce the behavior:
8-
1. Go to '...'
9-
2. Click on '....'
10-
3. Scroll down to '....'
11-
4. See error
12-
13-
**Expected behavior**
14-
A clear and concise description of what you expected to happen.
15-
166
**Screenshots**
177
If applicable, add screenshots to help explain your problem.
188

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
Real-time face swap and video deepfake with a single click and only a single image.
55
</p>
66

7+
<p align="center">
8+
<a href="https://trendshift.io/repositories/11395" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11395" alt="hacksider%2FDeep-Live-Cam | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
9+
</p>
10+
711
<p align="center">
812
<img src="media/demo.gif" alt="Demo GIF">
913
<img src="media/avgpcperformancedemo.gif" alt="Performance Demo GIF">
1014
</p>
1115

16+
1217
## Disclaimer
1318

1419
This software is intended as a productive contribution to the AI-generated media industry. It aims to assist artists with tasks like animating custom characters or using them as models for clothing, etc.

modules/processors/frame/face_enhancer.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from modules.typing import Frame, Face
1212
from modules.utilities import (
1313
conditional_download,
14-
resolve_relative_path,
1514
is_image,
1615
is_video,
1716
)
@@ -21,9 +20,11 @@
2120
THREAD_LOCK = threading.Lock()
2221
NAME = "DLC.FACE-ENHANCER"
2322

23+
abs_dir = os.path.dirname(os.path.abspath(__file__))
24+
models_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(abs_dir))), 'models')
2425

2526
def pre_check() -> bool:
26-
download_directory_path = resolve_relative_path("..\models")
27+
download_directory_path = models_dir
2728
conditional_download(
2829
download_directory_path,
2930
[
@@ -47,11 +48,7 @@ def get_face_enhancer() -> Any:
4748

4849
with THREAD_LOCK:
4950
if FACE_ENHANCER is None:
50-
if os.name == "nt":
51-
model_path = resolve_relative_path("..\models\GFPGANv1.4.pth")
52-
# todo: set models path https://github.com/TencentARC/GFPGAN/issues/399
53-
else:
54-
model_path = resolve_relative_path("../models/GFPGANv1.4.pth")
51+
model_path = os.path.join(models_dir, 'GFPGANv1.4.pth')
5552
FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1) # type: ignore[attr-defined]
5653
return FACE_ENHANCER
5754

modules/processors/frame/face_swapper.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@
1010
from modules.typing import Face, Frame
1111
from modules.utilities import (
1212
conditional_download,
13-
resolve_relative_path,
1413
is_image,
1514
is_video,
1615
)
1716
from modules.cluster_analysis import find_closest_centroid
17+
import os
1818

1919
FACE_SWAPPER = None
2020
THREAD_LOCK = threading.Lock()
2121
NAME = "DLC.FACE-SWAPPER"
2222

23+
abs_dir = os.path.dirname(os.path.abspath(__file__))
24+
models_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(abs_dir))), 'models')
2325

2426
def pre_check() -> bool:
25-
download_directory_path = resolve_relative_path("../models")
27+
download_directory_path = abs_dir
2628
conditional_download(
2729
download_directory_path,
2830
[
@@ -54,7 +56,7 @@ def get_face_swapper() -> Any:
5456

5557
with THREAD_LOCK:
5658
if FACE_SWAPPER is None:
57-
model_path = resolve_relative_path("../models/inswapper_128_fp16.onnx")
59+
model_path = os.path.join(models_dir, 'inswapper_128_fp16.onnx')
5860
FACE_SWAPPER = insightface.model_zoo.get_model(
5961
model_path, providers=modules.globals.execution_providers
6062
)

0 commit comments

Comments
 (0)