From f122006024244e8d30c7365137ae1b29c7f9aadf Mon Sep 17 00:00:00 2001 From: pereiraroland26 Date: Tue, 10 Sep 2024 14:28:33 +0530 Subject: [PATCH] updated README.md and created variables for pop dimensions --- README.md | 1 + modules/core.py | 2 +- modules/globals.py | 2 +- modules/ui.py | 18 ++++++++++++++---- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b045426..b203ad1 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ options: --keep-audio keep original audio --keep-frames keep temporary frames --many-faces process every face + --map-faces map source target faces --nsfw-filter filter the NSFW image or video --video-encoder {libx264,libx265,libvpx-vp9} adjust output video encoder --video-quality [0-51] adjust output video quality diff --git a/modules/core.py b/modules/core.py index fa7fb15..55707e2 100644 --- a/modules/core.py +++ b/modules/core.py @@ -40,7 +40,7 @@ def parse_args() -> None: program.add_argument('--keep-frames', help='keep temporary frames', dest='keep_frames', action='store_true', default=False) program.add_argument('--many-faces', help='process every face', dest='many_faces', action='store_true', default=False) program.add_argument('--nsfw-filter', help='filter the NSFW image or video', dest='nsfw_filter', action='store_true', default=False) - program.add_argument('--map-faces', help='create face maps', dest='map_faces', action='store_true', default=False) + program.add_argument('--map-faces', help='map source target faces', dest='map_faces', action='store_true', default=False) program.add_argument('--video-encoder', help='adjust output video encoder', dest='video_encoder', default='libx264', choices=['libx264', 'libx265', 'libvpx-vp9']) program.add_argument('--video-quality', help='adjust output video quality', dest='video_quality', type=int, default=18, choices=range(52), metavar='[0-51]') program.add_argument('--live-mirror', help='The live camera display as you see it in the front-facing camera frame', dest='live_mirror', action='store_true', default=False) diff --git a/modules/globals.py b/modules/globals.py index fcf7dfd..16ed2b5 100644 --- a/modules/globals.py +++ b/modules/globals.py @@ -10,7 +10,7 @@ file_types = [ ] souce_target_map = [] -simple_map = [] +simple_map = {} source_path = None target_path = None diff --git a/modules/ui.py b/modules/ui.py index 04708fb..f1a5995 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -24,6 +24,16 @@ PREVIEW_MAX_WIDTH = 1200 PREVIEW_DEFAULT_WIDTH = 960 PREVIEW_DEFAULT_HEIGHT = 540 +POPUP_WIDTH = 750 +POPUP_HEIGHT = 810 +POPUP_SCROLL_WIDTH = 740, +POPUP_SCROLL_HEIGHT = 700 + +POPUP_LIVE_WIDTH = 950 +POPUP_LIVE_HEIGHT = 820 +POPUP_LIVE_SCROLL_WIDTH = 940, +POPUP_LIVE_SCROLL_HEIGHT = 700 + MAPPER_PREVIEW_MAX_HEIGHT = 100 MAPPER_PREVIEW_MAX_WIDTH = 100 @@ -165,7 +175,7 @@ def create_source_target_popup(start: Callable[[], None], root: ctk.CTk, map: li POPUP = ctk.CTkToplevel(root) POPUP.title("Source x Target Mapper") - POPUP.geometry(f"{ROOT_WIDTH+150}x{ROOT_HEIGHT+110}") + POPUP.geometry(f"{POPUP_WIDTH}x{POPUP_HEIGHT}") POPUP.focus() def on_submit_click(start): @@ -175,7 +185,7 @@ def create_source_target_popup(start: Callable[[], None], root: ctk.CTk, map: li else: update_pop_status("Atleast 1 source with target is required!") - scrollable_frame = ctk.CTkScrollableFrame(POPUP, width=ROOT_WIDTH+140, height=ROOT_HEIGHT) + scrollable_frame = ctk.CTkScrollableFrame(POPUP, width=POPUP_SCROLL_WIDTH, height=POPUP_SCROLL_HEIGHT) scrollable_frame.grid(row=0, column=0, padx=0, pady=0, sticky='nsew') def on_button_click(map, button_num): @@ -508,7 +518,7 @@ def create_source_target_popup_for_webcam(root: ctk.CTk, map: list) -> None: POPUP_LIVE = ctk.CTkToplevel(root) POPUP_LIVE.title("Source x Target Mapper") - POPUP_LIVE.geometry(f"{ROOT_WIDTH+350}x{ROOT_HEIGHT+120}") + POPUP_LIVE.geometry(f"{POPUP_LIVE_WIDTH}x{POPUP_LIVE_HEIGHT}") POPUP_LIVE.focus() def on_submit_click(): @@ -537,7 +547,7 @@ def create_source_target_popup_for_webcam(root: ctk.CTk, map: list) -> None: def refresh_data(map: list): global POPUP_LIVE - scrollable_frame = ctk.CTkScrollableFrame(POPUP_LIVE, width=ROOT_WIDTH+340, height=ROOT_HEIGHT) + scrollable_frame = ctk.CTkScrollableFrame(POPUP_LIVE, width=POPUP_LIVE_SCROLL_WIDTH, height=POPUP_LIVE_SCROLL_HEIGHT) scrollable_frame.grid(row=0, column=0, padx=0, pady=0, sticky='nsew') def on_sbutton_click(map, button_num):