3.0.0 Gold (#787)

* Replace audio whenever set via source

* use scale_face_landmark_5() in age_modifier

* Fix wording and ordering of options

* Adjust wording for face editor

* Fix wording for processors

* Switch order of frame colorizer options

* That condition is actual not needed

* Simplify UI layout API by removing pre_render()

* Clean args and safe cast ini values (#775)

* Clean args and safe cast ini values

* Clean args and safe cast ini values

* Clean args and safe cast ini values

* Introduce paths group

* Fix job list command and change order

* Add job list testing todo

* Fix spacing in typing

* Fix benchmark by ignoring audio

* Simplify and avoid knowing the provider values (#782)

* Fix logger table with empty value

* Complete Typing

---------

Co-authored-by: harisreedhar <h4harisreedhar.s.s@gmail.com>
This commit is contained in:
Henry Ruhs
2024-10-02 11:08:05 +02:00
committed by GitHub
co-authored by harisreedhar
parent 904de93565
commit e42f91dadf
27 changed files with 208 additions and 155 deletions
@@ -13,7 +13,7 @@ from facefusion import config, content_analyser, face_classifier, face_detector,
from facefusion.common_helper import create_int_metavar
from facefusion.download import conditional_download_hashes, conditional_download_sources
from facefusion.face_analyser import get_many_faces, get_one_face
from facefusion.face_helper import merge_matrix, paste_back, warp_face_by_face_landmark_5
from facefusion.face_helper import merge_matrix, paste_back, scale_face_landmark_5, warp_face_by_face_landmark_5
from facefusion.face_masker import create_occlusion_mask, create_static_box_mask
from facefusion.face_selector import find_similar_faces, sort_and_filter_faces
from facefusion.face_store import get_reference_faces
@@ -119,7 +119,7 @@ def modify_age(target_face : Face, temp_vision_frame : VisionFrame) -> VisionFra
model_size = get_model_options().get('size')
crop_size = (model_size[0] // 2, model_size[1] // 2)
face_landmark_5 = target_face.landmark_set.get('5/68').copy()
extend_face_landmark_5 = (face_landmark_5 - face_landmark_5[2]) * 2 + face_landmark_5[2]
extend_face_landmark_5 = scale_face_landmark_5(face_landmark_5, 2.0)
crop_vision_frame, affine_matrix = warp_face_by_face_landmark_5(temp_vision_frame, face_landmark_5, model_template, crop_size)
extend_vision_frame, extend_affine_matrix = warp_face_by_face_landmark_5(temp_vision_frame, extend_face_landmark_5, model_template, model_size)
extend_vision_frame_raw = extend_vision_frame.copy()
+2 -2
View File
@@ -132,8 +132,8 @@ def register_args(program : ArgumentParser) -> None:
group_processors.add_argument('--face-editor-mouth-position-horizontal', help = wording.get('help.face_editor_mouth_position_horizontal'), type = float, default = config.get_float_value('processors.face_editor_mouth_position_horizontal', '0'), choices = processors_choices.face_editor_mouth_position_horizontal_range, metavar = create_float_metavar(processors_choices.face_editor_mouth_position_horizontal_range))
group_processors.add_argument('--face-editor-mouth-position-vertical', help = wording.get('help.face_editor_mouth_position_vertical'), type = float, default = config.get_float_value('processors.face_editor_mouth_position_vertical', '0'), choices = processors_choices.face_editor_mouth_position_vertical_range, metavar = create_float_metavar(processors_choices.face_editor_mouth_position_vertical_range))
group_processors.add_argument('--face-editor-head-pitch', help = wording.get('help.face_editor_head_pitch'), type = float, default = config.get_float_value('processors.face_editor_head_pitch', '0'), choices = processors_choices.face_editor_head_pitch_range, metavar = create_float_metavar(processors_choices.face_editor_head_pitch_range))
group_processors.add_argument('--face-editor-head-yaw', help=wording.get('help.face_editor_head_yaw'), type = float, default = config.get_float_value('processors.face_editor_head_yaw', '0'), choices = processors_choices.face_editor_head_yaw_range, metavar = create_float_metavar(processors_choices.face_editor_head_yaw_range))
group_processors.add_argument('--face-editor-head-roll', help=wording.get('help.face_editor_head_roll'), type = float, default = config.get_float_value('processors.face_editor_head_roll', '0'), choices = processors_choices.face_editor_head_roll_range, metavar = create_float_metavar(processors_choices.face_editor_head_roll_range))
group_processors.add_argument('--face-editor-head-yaw', help = wording.get('help.face_editor_head_yaw'), type = float, default = config.get_float_value('processors.face_editor_head_yaw', '0'), choices = processors_choices.face_editor_head_yaw_range, metavar = create_float_metavar(processors_choices.face_editor_head_yaw_range))
group_processors.add_argument('--face-editor-head-roll', help = wording.get('help.face_editor_head_roll'), type = float, default = config.get_float_value('processors.face_editor_head_roll', '0'), choices = processors_choices.face_editor_head_roll_range, metavar = create_float_metavar(processors_choices.face_editor_head_roll_range))
facefusion.jobs.job_store.register_step_keys([ 'face_editor_model', 'face_editor_eyebrow_direction', 'face_editor_eye_gaze_horizontal', 'face_editor_eye_gaze_vertical', 'face_editor_eye_open_ratio', 'face_editor_lip_open_ratio', 'face_editor_mouth_grim', 'face_editor_mouth_pout', 'face_editor_mouth_purse', 'face_editor_mouth_smile', 'face_editor_mouth_position_horizontal', 'face_editor_mouth_position_vertical', 'face_editor_head_pitch', 'face_editor_head_yaw', 'face_editor_head_roll' ])
@@ -143,8 +143,8 @@ def register_args(program : ArgumentParser) -> None:
group_processors = find_argument_group(program, 'processors')
if group_processors:
group_processors.add_argument('--frame-colorizer-model', help = wording.get('help.frame_colorizer_model'), default = config.get_str_value('processors.frame_colorizer_model', 'ddcolor'), choices = processors_choices.frame_colorizer_models)
group_processors.add_argument('--frame-colorizer-blend', help = wording.get('help.frame_colorizer_blend'), type = int, default = config.get_int_value('processors.frame_colorizer_blend', '100'), choices = processors_choices.frame_colorizer_blend_range, metavar = create_int_metavar(processors_choices.frame_colorizer_blend_range))
group_processors.add_argument('--frame-colorizer-size', help = wording.get('help.frame_colorizer_size'), type = str, default = config.get_str_value('processors.frame_colorizer_size', '256x256'), choices = processors_choices.frame_colorizer_sizes)
group_processors.add_argument('--frame-colorizer-blend', help = wording.get('help.frame_colorizer_blend'), type = int, default = config.get_int_value('processors.frame_colorizer_blend', '100'), choices = processors_choices.frame_colorizer_blend_range, metavar = create_int_metavar(processors_choices.frame_colorizer_blend_range))
facefusion.jobs.job_store.register_step_keys([ 'frame_colorizer_model', 'frame_colorizer_blend', 'frame_colorizer_size' ])
+21 -4
View File
@@ -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