Compare commits
5 Commits
6e48b48cd2
...
90a93299e9
Author | SHA1 | Date |
---|---|---|
|
90a93299e9 | |
|
40598daea9 | |
|
528c30e3ba | |
|
36d560dd1e | |
|
8172f90f1d |
|
@ -24,7 +24,7 @@ Users of this software are expected to use this software responsibly while abidi
|
||||||
#### 3. Download Models
|
#### 3. Download Models
|
||||||
|
|
||||||
1. [GFPGANv1.4](https://huggingface.co/hacksider/deep-live-cam/resolve/main/GFPGANv1.4.pth)
|
1. [GFPGANv1.4](https://huggingface.co/hacksider/deep-live-cam/resolve/main/GFPGANv1.4.pth)
|
||||||
2. [inswapper_128_fp16.onnx](https://huggingface.co/hacksider/deep-live-cam/resolve/main/inswapper_128_fp16.onnx)
|
2. [inswapper_128_fp16.onnx](https://github.com/facefusion/facefusion-assets/releases/download/models/inswapper_128_fp16.onnx)
|
||||||
|
|
||||||
Then put those 2 files on the "**models**" folder
|
Then put those 2 files on the "**models**" folder
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,9 @@ def create_root(start: Callable[[], None], destroy: Callable[[], None]) -> ctk.C
|
||||||
select_face_button = ctk.CTkButton(root, text='Select a face', cursor='hand2', command=lambda: select_source_path())
|
select_face_button = ctk.CTkButton(root, text='Select a face', cursor='hand2', command=lambda: select_source_path())
|
||||||
select_face_button.place(relx=0.1, rely=0.4, relwidth=0.3, relheight=0.1)
|
select_face_button.place(relx=0.1, rely=0.4, relwidth=0.3, relheight=0.1)
|
||||||
|
|
||||||
|
swap_faces_button = ctk.CTkButton(root, text='↔', cursor='hand2', command=lambda: swap_faces_paths())
|
||||||
|
swap_faces_button.place(relx=0.45, rely=0.4, relwidth=0.1, relheight=0.1)
|
||||||
|
|
||||||
select_target_button = ctk.CTkButton(root, text='Select a target', cursor='hand2', command=lambda: select_target_path())
|
select_target_button = ctk.CTkButton(root, text='Select a target', cursor='hand2', command=lambda: select_target_path())
|
||||||
select_target_button.place(relx=0.6, rely=0.4, relwidth=0.3, relheight=0.1)
|
select_target_button.place(relx=0.6, rely=0.4, relwidth=0.3, relheight=0.1)
|
||||||
|
|
||||||
|
@ -159,6 +162,30 @@ def select_source_path() -> None:
|
||||||
source_label.configure(image=None)
|
source_label.configure(image=None)
|
||||||
|
|
||||||
|
|
||||||
|
def swap_faces_paths() -> None:
|
||||||
|
global RECENT_DIRECTORY_SOURCE, RECENT_DIRECTORY_TARGET
|
||||||
|
|
||||||
|
source_path = modules.globals.source_path
|
||||||
|
target_path = modules.globals.target_path
|
||||||
|
|
||||||
|
if not is_image(source_path) or not is_image(target_path):
|
||||||
|
return
|
||||||
|
|
||||||
|
modules.globals.source_path = target_path
|
||||||
|
modules.globals.target_path = source_path
|
||||||
|
|
||||||
|
RECENT_DIRECTORY_SOURCE = os.path.dirname(modules.globals.source_path)
|
||||||
|
RECENT_DIRECTORY_TARGET = os.path.dirname(modules.globals.target_path)
|
||||||
|
|
||||||
|
PREVIEW.withdraw()
|
||||||
|
|
||||||
|
source_image = render_image_preview(modules.globals.source_path, (200, 200))
|
||||||
|
source_label.configure(image=source_image)
|
||||||
|
|
||||||
|
target_image = render_image_preview(modules.globals.target_path, (200, 200))
|
||||||
|
target_label.configure(image=target_image)
|
||||||
|
|
||||||
|
|
||||||
def select_target_path() -> None:
|
def select_target_path() -> None:
|
||||||
global RECENT_DIRECTORY_TARGET, img_ft, vid_ft
|
global RECENT_DIRECTORY_TARGET, img_ft, vid_ft
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue