Compare commits

..

4 Commits

Author SHA1 Message Date
KRSHH 2a7ae010a8
Raised img Res 2025-01-06 23:53:18 +05:30
KRSHH a834811974
Add URL to buttons
Forgot to add before (regarded)
2025-01-06 23:23:19 +05:30
KRSHH d2aaf46e69
Change buttons 2025-01-06 23:13:57 +05:30
Makaru d07d4a6a26 Update ui.py
I pushed it to premain
2025-01-07 01:15:05 +08:00
2 changed files with 68 additions and 28 deletions

View File

@ -20,20 +20,15 @@
###### Users are expected to use this software responsibly and legally. If using a real person's face, obtain their consent and clearly label any output as a deepfake when sharing online. We are not responsible for end-user actions.
## Quick Start - Download Prebuilt
<div style="margin: 28px 0;">
<div style="margin-bottom: 20px;">
<a href="https://hacksider.gumroad.com/l/vccdmm" target="_blank">
<img src="https://github.com/user-attachments/assets/c702bb7d-d9c0-466a-9ad2-02849294e540" alt="Download Button 1" style="width: 280px; display: block;">
## Quick Start - Pre-built
<div align="center">
<a href="https://hacksider.gumroad.com/l/vccdmm">
<img src="https://github.com/user-attachments/assets/7d993b32-e3e8-4cd3-bbfb-a549152ebdd5" width="285" height="77" />
</a>
</div>
<div>
<a href="https://krshh.gumroad.com/l/Deep-Live-Cam-Mac" target="_blank">
<img src="https://github.com/user-attachments/assets/9a302750-2d54-457d-bdc8-6ed7c6af0e1a" alt="Download Button 2" style="width: 280px; display: block;">
<a href="https://krshh.gumroad.com/l/Deep-Live-Cam-Mac">
<img src="https://github.com/user-attachments/assets/d5d913b5-a7de-4609-96b9-979a5749a703" width="285" height="77" />
</a>
</div>
</div>
## Features - Everything is real-time

View File

@ -262,6 +262,7 @@ def create_root(start: Callable[[], None], destroy: Callable[[], None]) -> ctk.C
command=lambda: (
setattr(modules.globals, "map_faces", map_faces.get()),
save_switch_states(),
close_mapper_window() if not map_faces.get() else None
),
)
map_faces_switch.place(relx=0.1, rely=0.75)
@ -376,6 +377,15 @@ def create_root(start: Callable[[], None], destroy: Callable[[], None]) -> ctk.C
return root
def close_mapper_window():
global POPUP, POPUP_LIVE
if POPUP and POPUP.winfo_exists():
POPUP.destroy()
POPUP = None
if POPUP_LIVE and POPUP_LIVE.winfo_exists():
POPUP_LIVE.destroy()
POPUP_LIVE = None
def analyze_target(start: Callable[[], None], root: ctk.CTk):
if POPUP != None and POPUP.winfo_exists():
@ -760,6 +770,13 @@ def update_preview(frame_number: int = 0) -> None:
def webcam_preview(root: ctk.CTk, camera_index: int):
global POPUP_LIVE
if POPUP_LIVE and POPUP_LIVE.winfo_exists():
update_status("Source x Target Mapper is already open.")
POPUP_LIVE.focus()
return
if not modules.globals.map_faces:
if modules.globals.source_path is None:
update_status("Please select a source image first")
@ -772,6 +789,7 @@ def webcam_preview(root: ctk.CTk, camera_index: int):
)
def get_available_cameras():
"""Returns a list of available camera names and indices."""
if platform.system() == "Windows":
@ -946,9 +964,9 @@ def create_source_target_popup_for_webcam(
def on_submit_click():
if has_valid_map():
POPUP_LIVE.destroy()
simplify_maps()
create_webcam_preview(camera_index)
update_pop_live_status("Mappings successfully submitted!")
create_webcam_preview(camera_index) # Open the preview window
else:
update_pop_live_status("At least 1 source with target is required!")
@ -957,16 +975,43 @@ def create_source_target_popup_for_webcam(
refresh_data(map)
update_pop_live_status("Please provide mapping!")
def on_clear_click():
clear_source_target_images(map)
refresh_data(map)
update_pop_live_status("All mappings cleared!")
popup_status_label_live = ctk.CTkLabel(POPUP_LIVE, text=None, justify="center")
popup_status_label_live.grid(row=1, column=0, pady=15)
add_button = ctk.CTkButton(POPUP_LIVE, text="Add", command=lambda: on_add_click())
add_button.place(relx=0.2, rely=0.92, relwidth=0.2, relheight=0.05)
add_button.place(relx=0.1, rely=0.92, relwidth=0.2, relheight=0.05)
clear_button = ctk.CTkButton(POPUP_LIVE, text="Clear", command=lambda: on_clear_click())
clear_button.place(relx=0.4, rely=0.92, relwidth=0.2, relheight=0.05)
close_button = ctk.CTkButton(
POPUP_LIVE, text="Submit", command=lambda: on_submit_click()
)
close_button.place(relx=0.6, rely=0.92, relwidth=0.2, relheight=0.05)
close_button.place(relx=0.7, rely=0.92, relwidth=0.2, relheight=0.05)
def clear_source_target_images(map: list):
global source_label_dict_live, target_label_dict_live
for item in map:
if "source" in item:
del item["source"]
if "target" in item:
del item["target"]
for button_num in list(source_label_dict_live.keys()):
source_label_dict_live[button_num].destroy()
del source_label_dict_live[button_num]
for button_num in list(target_label_dict_live.keys()):
target_label_dict_live[button_num].destroy()
del target_label_dict_live[button_num]
def refresh_data(map: list):