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
parent 904de93565
commit e42f91dadf
27 changed files with 208 additions and 155 deletions

View File

@@ -82,6 +82,7 @@ def start(benchmark_runs : List[str], benchmark_cycles : int) -> Generator[List[
state_manager.init_item('face_landmarker_score', 0)
state_manager.init_item('temp_frame_format', 'bmp')
state_manager.init_item('output_video_preset', 'ultrafast')
state_manager.init_item('skip_audio', True)
state_manager.sync_item('execution_providers')
state_manager.sync_item('execution_thread_count')
state_manager.sync_item('execution_queue_count')

View File

@@ -10,14 +10,14 @@ from facefusion.processors.typing import FrameColorizerModel
from facefusion.uis.core import get_ui_component, register_ui_component
FRAME_COLORIZER_MODEL_DROPDOWN : Optional[gradio.Dropdown] = None
FRAME_COLORIZER_BLEND_SLIDER : Optional[gradio.Slider] = None
FRAME_COLORIZER_SIZE_DROPDOWN : Optional[gradio.Dropdown] = None
FRAME_COLORIZER_BLEND_SLIDER : Optional[gradio.Slider] = None
def render() -> None:
global FRAME_COLORIZER_MODEL_DROPDOWN
global FRAME_COLORIZER_BLEND_SLIDER
global FRAME_COLORIZER_SIZE_DROPDOWN
global FRAME_COLORIZER_BLEND_SLIDER
FRAME_COLORIZER_MODEL_DROPDOWN = gradio.Dropdown(
label = wording.get('uis.frame_colorizer_model_dropdown'),
@@ -25,6 +25,12 @@ def render() -> None:
value = state_manager.get_item('frame_colorizer_model'),
visible = 'frame_colorizer' in state_manager.get_item('processors')
)
FRAME_COLORIZER_SIZE_DROPDOWN = gradio.Dropdown(
label = wording.get('uis.frame_colorizer_size_dropdown'),
choices = processors_choices.frame_colorizer_sizes,
value = state_manager.get_item('frame_colorizer_size'),
visible = 'frame_colorizer' in state_manager.get_item('processors')
)
FRAME_COLORIZER_BLEND_SLIDER = gradio.Slider(
label = wording.get('uis.frame_colorizer_blend_slider'),
value = state_manager.get_item('frame_colorizer_blend'),
@@ -33,21 +39,15 @@ def render() -> None:
maximum = processors_choices.frame_colorizer_blend_range[-1],
visible = 'frame_colorizer' in state_manager.get_item('processors')
)
FRAME_COLORIZER_SIZE_DROPDOWN = gradio.Dropdown(
label = wording.get('uis.frame_colorizer_size_dropdown'),
choices = processors_choices.frame_colorizer_sizes,
value = state_manager.get_item('frame_colorizer_size'),
visible = 'frame_colorizer' in state_manager.get_item('processors')
)
register_ui_component('frame_colorizer_model_dropdown', FRAME_COLORIZER_MODEL_DROPDOWN)
register_ui_component('frame_colorizer_blend_slider', FRAME_COLORIZER_BLEND_SLIDER)
register_ui_component('frame_colorizer_size_dropdown', FRAME_COLORIZER_SIZE_DROPDOWN)
register_ui_component('frame_colorizer_blend_slider', FRAME_COLORIZER_BLEND_SLIDER)
def listen() -> None:
FRAME_COLORIZER_MODEL_DROPDOWN.change(update_frame_colorizer_model, inputs = FRAME_COLORIZER_MODEL_DROPDOWN, outputs = FRAME_COLORIZER_MODEL_DROPDOWN)
FRAME_COLORIZER_BLEND_SLIDER.release(update_frame_colorizer_blend, inputs = FRAME_COLORIZER_BLEND_SLIDER)
FRAME_COLORIZER_SIZE_DROPDOWN.change(update_frame_colorizer_size, inputs = FRAME_COLORIZER_SIZE_DROPDOWN)
FRAME_COLORIZER_BLEND_SLIDER.release(update_frame_colorizer_blend, inputs = FRAME_COLORIZER_BLEND_SLIDER)
processors_checkbox_group = get_ui_component('processors_checkbox_group')
if processors_checkbox_group:
@@ -69,9 +69,12 @@ def update_frame_colorizer_model(frame_colorizer_model : FrameColorizerModel) ->
return gradio.Dropdown()
def update_frame_colorizer_size(frame_colorizer_size : str) -> None:
state_manager.set_item('frame_colorizer_size', frame_colorizer_size)
def update_frame_colorizer_blend(frame_colorizer_blend : float) -> None:
state_manager.set_item('frame_colorizer_blend', int(frame_colorizer_blend))
def update_frame_colorizer_size(frame_colorizer_size : str) -> None:
state_manager.set_item('frame_colorizer_size', frame_colorizer_size)

View File

@@ -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

View File

@@ -25,7 +25,6 @@ UI_LAYOUT_MODULES : List[ModuleType] = []
UI_LAYOUT_METHODS =\
[
'pre_check',
'pre_render',
'render',
'listen',
'run'
@@ -83,14 +82,14 @@ def launch() -> None:
with gradio.Blocks(theme = get_theme(), css = get_css(), title = metadata.get('name') + ' ' + metadata.get('version'), fill_width = True) as ui:
for ui_layout in state_manager.get_item('ui_layouts'):
ui_layout_module = load_ui_layout_module(ui_layout)
if ui_layout_module.pre_render():
if ui_layouts_total > 1:
with gradio.Tab(ui_layout):
ui_layout_module.render()
ui_layout_module.listen()
else:
if ui_layouts_total > 1:
with gradio.Tab(ui_layout):
ui_layout_module.render()
ui_layout_module.listen()
else:
ui_layout_module.render()
ui_layout_module.listen()
for ui_layout in state_manager.get_item('ui_layouts'):
ui_layout_module = load_ui_layout_module(ui_layout)

View File

@@ -23,10 +23,6 @@ def pre_check() -> bool:
return False
def pre_render() -> bool:
return True
def render() -> gradio.Blocks:
with gradio.Blocks() as layout:
with gradio.Row():

View File

@@ -8,10 +8,6 @@ def pre_check() -> bool:
return True
def pre_render() -> bool:
return True
def render() -> gradio.Blocks:
with gradio.Blocks() as layout:
with gradio.Row():

View File

@@ -8,10 +8,6 @@ def pre_check() -> bool:
return True
def pre_render() -> bool:
return True
def render() -> gradio.Blocks:
with gradio.Blocks() as layout:
with gradio.Row():

View File

@@ -8,10 +8,6 @@ def pre_check() -> bool:
return True
def pre_render() -> bool:
return True
def render() -> gradio.Blocks:
with gradio.Blocks() as layout:
with gradio.Row():