mirror of
https://github.com/facefusion/facefusion.git
synced 2026-05-12 10:31:33 +02:00
a6809c3ccb
* Improve typing for our callbacks * Return 0 for get_download_size * Introduce ONNX powered face enhancer * Introduce ONNX powered face enhancer * Introduce ONNX powered face enhancer * Remove tile processing from frame enhancer * Fix video compress translation for libvpx-vp9 * Allow zero values for video compression * Develop (#134) * Introduce model options to the frame processors * Finish UI to select frame processors models * Simplify frame processors options * Fix lint in CI * Rename all kind of settings to options * Add blend to enhancers * Simplify webcam mode naming * Bypass SSL issues under Windows * Fix blend of frame enhancer * Massive CLI refactoring, Register and apply ARGS via the frame processors * Refine UI theme and introduce donate button * Update dependencies and fix cpu only torch * Update dependencies and fix cpu only torch * Fix theme, Fix frame_processors in headless mode * Remove useless astype * Disable CoreML for the ONNX face enhancer * Disable CoreML for the ONNX face enhancer * Predict webcam too * Improve resize of preview * Change output quality defaults, Move options to the right * Support for codeformer model * Update the typo * Add GPEN and GFPGAN 1.2 * Extract blend_frame methods * Extend the installer * Revert broken Gradio * Rework on ui components * Move output path selector to the output options * Remove tons of pointless component updates * Reset more base theme styling * Use latest Gradio * Fix the sliders * More styles * Update torch to 2.1.0 * Add RealESRNet_x4plus * Fix that button * Use latest onnxruntime-silicon * Looks stable to me * Lowercase model keys, Update preview and readme
35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
from typing import List, Optional
|
|
import gradio
|
|
import onnxruntime
|
|
|
|
import facefusion.globals
|
|
from facefusion import wording
|
|
from facefusion.face_analyser import clear_face_analyser
|
|
from facefusion.processors.frame.core import clear_frame_processors_modules
|
|
from facefusion.utilities import encode_execution_providers, decode_execution_providers
|
|
|
|
EXECUTION_PROVIDERS_CHECKBOX_GROUP : Optional[gradio.CheckboxGroup] = None
|
|
|
|
|
|
def render() -> None:
|
|
global EXECUTION_PROVIDERS_CHECKBOX_GROUP
|
|
|
|
EXECUTION_PROVIDERS_CHECKBOX_GROUP = gradio.CheckboxGroup(
|
|
label = wording.get('execution_providers_checkbox_group_label'),
|
|
choices = encode_execution_providers(onnxruntime.get_available_providers()),
|
|
value = encode_execution_providers(facefusion.globals.execution_providers)
|
|
)
|
|
|
|
|
|
def listen() -> None:
|
|
EXECUTION_PROVIDERS_CHECKBOX_GROUP.change(update_execution_providers, inputs = EXECUTION_PROVIDERS_CHECKBOX_GROUP, outputs = EXECUTION_PROVIDERS_CHECKBOX_GROUP)
|
|
|
|
|
|
def update_execution_providers(execution_providers : List[str]) -> gradio.CheckboxGroup:
|
|
clear_face_analyser()
|
|
clear_frame_processors_modules()
|
|
if not execution_providers:
|
|
execution_providers = encode_execution_providers(onnxruntime.get_available_providers())
|
|
facefusion.globals.execution_providers = decode_execution_providers(execution_providers)
|
|
return gradio.CheckboxGroup(value = execution_providers)
|