Deep-Live-Cam/modules/globals.py

51 lines
1.6 KiB
Python
Raw Normal View History

2023-09-24 21:36:57 +08:00
import os
2024-09-10 07:07:58 +08:00
from typing import List, Dict, Any
2023-09-24 21:36:57 +08:00
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
2024-10-09 22:20:20 +08:00
WORKFLOW_DIR = os.path.join(ROOT_DIR, "workflow")
2023-09-24 21:36:57 +08:00
file_types = [
2024-10-09 22:20:20 +08:00
("Image", ("*.png", "*.jpg", "*.jpeg", "*.gif", "*.bmp")),
("Video", ("*.mp4", "*.mkv")),
2023-09-24 21:36:57 +08:00
]
source_target_map = []
simple_map = {}
2024-09-10 07:07:58 +08:00
2023-09-24 21:36:57 +08:00
source_path = None
target_path = None
output_path = None
frame_processors: List[str] = []
2024-10-09 22:20:20 +08:00
keep_fps = True
keep_audio = True
keep_frames = False
many_faces = False
map_faces = False
color_correction = False # New global variable for color correction toggle
nsfw_filter = False
2023-09-24 21:36:57 +08:00
video_encoder = None
video_quality = None
2024-10-09 22:20:20 +08:00
live_mirror = False
2024-12-13 22:19:11 +08:00
live_resizable = True
2023-09-24 21:36:57 +08:00
max_memory = None
execution_providers: List[str] = []
execution_threads = None
headless = None
2024-10-09 22:20:20 +08:00
log_level = "error"
fp_ui: Dict[str, bool] = {"face_enhancer": False}
2023-12-14 14:59:22 +08:00
camera_input_combobox = None
2024-10-06 23:06:57 +08:00
webcam_preview_running = False
show_fps = False
2024-10-25 23:29:30 +08:00
mouth_mask = False
show_mouth_mask_box = False
mask_feather_ratio = 8
mask_down_size = 0.50
mask_size = 1
use_poisson_blending = False # Added for Poisson blending
poisson_blending_feather_amount = 5 # Feathering for the mask before Poisson blending
preserve_target_ears = False # Flag to enable preserving target's ears
ear_width_ratio = 0.18 # Width of the ear exclusion box as a ratio of face bbox width
ear_height_ratio = 0.35 # Height of the ear exclusion box as a ratio of face bbox height
ear_vertical_offset_ratio = 0.20 # Vertical offset of the ear box from top of face bbox
ear_horizontal_overlap_ratio = 0.03 # How much the ear exclusion zone can overlap into the face bbox