File tree 4 files changed +15
-21
lines changed
4 files changed +15
-21
lines changed Original file line number Diff line number Diff line change 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. ***
2
2
3
3
** Describe the bug**
4
4
A clear and concise description of what the bug is.
5
5
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
-
16
6
** Screenshots**
17
7
If applicable, add screenshots to help explain your problem.
18
8
Original file line number Diff line number Diff line change 4
4
Real-time face swap and video deepfake with a single click and only a single image.
5
5
</p >
6
6
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
+
7
11
<p align =" center " >
8
12
<img src =" media/demo.gif " alt =" Demo GIF " >
9
13
<img src =" media/avgpcperformancedemo.gif " alt =" Performance Demo GIF " >
10
14
</p >
11
15
16
+
12
17
## Disclaimer
13
18
14
19
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.
Original file line number Diff line number Diff line change 11
11
from modules .typing import Frame , Face
12
12
from modules .utilities import (
13
13
conditional_download ,
14
- resolve_relative_path ,
15
14
is_image ,
16
15
is_video ,
17
16
)
21
20
THREAD_LOCK = threading .Lock ()
22
21
NAME = "DLC.FACE-ENHANCER"
23
22
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' )
24
25
25
26
def pre_check () -> bool :
26
- download_directory_path = resolve_relative_path ( "..\models" )
27
+ download_directory_path = models_dir
27
28
conditional_download (
28
29
download_directory_path ,
29
30
[
@@ -47,11 +48,7 @@ def get_face_enhancer() -> Any:
47
48
48
49
with THREAD_LOCK :
49
50
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' )
55
52
FACE_ENHANCER = gfpgan .GFPGANer (model_path = model_path , upscale = 1 ) # type: ignore[attr-defined]
56
53
return FACE_ENHANCER
57
54
Original file line number Diff line number Diff line change 10
10
from modules .typing import Face , Frame
11
11
from modules .utilities import (
12
12
conditional_download ,
13
- resolve_relative_path ,
14
13
is_image ,
15
14
is_video ,
16
15
)
17
16
from modules .cluster_analysis import find_closest_centroid
17
+ import os
18
18
19
19
FACE_SWAPPER = None
20
20
THREAD_LOCK = threading .Lock ()
21
21
NAME = "DLC.FACE-SWAPPER"
22
22
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' )
23
25
24
26
def pre_check () -> bool :
25
- download_directory_path = resolve_relative_path ( "../models" )
27
+ download_directory_path = abs_dir
26
28
conditional_download (
27
29
download_directory_path ,
28
30
[
@@ -54,7 +56,7 @@ def get_face_swapper() -> Any:
54
56
55
57
with THREAD_LOCK :
56
58
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' )
58
60
FACE_SWAPPER = insightface .model_zoo .get_model (
59
61
model_path , providers = modules .globals .execution_providers
60
62
)
You can’t perform that action at this time.
0 commit comments