File tree Expand file tree Collapse file tree 4 files changed +15
-21
lines changed
Expand file tree Collapse file tree 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. ***
22
33** Describe the bug**
44A 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**
177If applicable, add screenshots to help explain your problem.
188
Original file line number Diff line number Diff line change 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
1419This 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 1111from modules .typing import Frame , Face
1212from modules .utilities import (
1313 conditional_download ,
14- resolve_relative_path ,
1514 is_image ,
1615 is_video ,
1716)
2120THREAD_LOCK = threading .Lock ()
2221NAME = "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
2526def 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
Original file line number Diff line number Diff line change 1010from modules .typing import Face , Frame
1111from modules .utilities import (
1212 conditional_download ,
13- resolve_relative_path ,
1413 is_image ,
1514 is_video ,
1615)
1716from modules .cluster_analysis import find_closest_centroid
17+ import os
1818
1919FACE_SWAPPER = None
2020THREAD_LOCK = threading .Lock ()
2121NAME = "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
2426def 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 )
You can’t perform that action at this time.
0 commit comments