From 564e504d5e78e5fa289f92e2e5e8ecfd58d099f9 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Wed, 2 Oct 2024 10:19:16 +0200 Subject: [PATCH] Complete Typing --- facefusion/processors/typing.py | 25 +++++++++++++++++++++---- facefusion/typing.py | 4 ++-- facefusion/uis/components/source.py | 2 +- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/facefusion/processors/typing.py b/facefusion/processors/typing.py index ae57587e..b1ef4c84 100644 --- a/facefusion/processors/typing.py +++ b/facefusion/processors/typing.py @@ -90,24 +90,41 @@ ProcessorStateKey = Literal\ 'face_swapper_model', 'face_swapper_pixel_boost', 'frame_colorizer_model', - 'frame_colorizer_blend', 'frame_colorizer_size', + 'frame_colorizer_blend', 'frame_enhancer_model', 'frame_enhancer_blend', 'lip_syncer_model' ] ProcessorState = TypedDict('ProcessorState', { - 'age_modifier_model': AgeModifierModel, - 'age_modifier_direction': int, + 'age_modifier_model' : AgeModifierModel, + 'age_modifier_direction' : int, + 'expression_restorer_model' : ExpressionRestorerModel, + 'expression_restorer_factor' : int, 'face_debugger_items' : List[FaceDebuggerItem], + 'face_editor_model' : FaceEditorModel, + 'face_editor_eyebrow_direction' : float, + 'face_editor_eye_gaze_horizontal' : float, + 'face_editor_eye_gaze_vertical' : float, + 'face_editor_eye_open_ratio' : float, + 'face_editor_lip_open_ratio' : float, + 'face_editor_mouth_grim' : float, + 'face_editor_mouth_pout' : float, + 'face_editor_mouth_purse' : float, + 'face_editor_mouth_smile' : float, + 'face_editor_mouth_position_horizontal' : float, + 'face_editor_mouth_position_vertical' : float, + 'face_editor_head_pitch' : float, + 'face_editor_head_yaw' : float, + 'face_editor_head_roll' : float, 'face_enhancer_model' : FaceEnhancerModel, 'face_enhancer_blend' : int, 'face_swapper_model' : FaceSwapperModel, 'face_swapper_pixel_boost' : str, 'frame_colorizer_model' : FrameColorizerModel, - 'frame_colorizer_blend' : int, 'frame_colorizer_size' : str, + 'frame_colorizer_blend' : int, 'frame_enhancer_model' : FrameEnhancerModel, 'frame_enhancer_blend' : int, 'lip_syncer_model' : LipSyncerModel diff --git a/facefusion/typing.py b/facefusion/typing.py index 2c5efe8e..5ce43ad5 100755 --- a/facefusion/typing.py +++ b/facefusion/typing.py @@ -259,7 +259,7 @@ State = TypedDict('State', 'face_landmarker_score' : Score, 'face_selector_mode' : FaceSelectorMode, 'face_selector_order' : FaceSelectorOrder, - 'face_selector_race': Race, + 'face_selector_race' : Race, 'face_selector_gender' : Gender, 'face_selector_age_start' : int, 'face_selector_age_end' : int, @@ -291,7 +291,7 @@ State = TypedDict('State', 'execution_providers' : List[ExecutionProviderKey], 'execution_thread_count' : int, 'execution_queue_count' : int, - 'video_memory_strategy': VideoMemoryStrategy, + 'video_memory_strategy' : VideoMemoryStrategy, 'system_memory_limit' : int, 'skip_download' : bool, 'log_level' : LogLevel, diff --git a/facefusion/uis/components/source.py b/facefusion/uis/components/source.py index 4f9c6f24..4b7d5720 100644 --- a/facefusion/uis/components/source.py +++ b/facefusion/uis/components/source.py @@ -21,13 +21,13 @@ def render() -> None: has_source_audio = has_audio(state_manager.get_item('source_paths')) has_source_image = has_image(state_manager.get_item('source_paths')) SOURCE_FILE = gradio.File( + label = wording.get('uis.source_file'), file_count = 'multiple', file_types = [ 'audio', 'image' ], - label = wording.get('uis.source_file'), value = state_manager.get_item('source_paths') if has_source_audio or has_source_image else None ) source_file_names = [ source_file_value.get('path') for source_file_value in SOURCE_FILE.value ] if SOURCE_FILE.value else None