* Clear VRAM of face analyser on post process

* Mark as NEXT

* Reduce tensorflow memory to 512 MB

* Cosmetics on installer

* Add is_download_done to pre_process() hook to prevent errors

* Use latest onnxruntime

* Testing for download methods, Make get_download_size more robust

* Testing for download methods

* Introduce --skip-download argument

* Catch exception causes by a firewall

* Looks stable to me
This commit is contained in:
Henry Ruhs
2023-09-22 10:28:38 +02:00
committed by GitHub
parent 66ea4928f8
commit 95bac6668c
16 changed files with 110 additions and 47 deletions

View File

@@ -2,6 +2,6 @@ from typing import List
from facefusion.uis.typing import WebcamMode
settings : List[str] = [ 'keep-fps', 'keep-temp', 'skip-audio' ]
settings : List[str] = [ 'keep-fps', 'keep-temp', 'skip-audio', 'skip-download' ]
webcam_mode : List[WebcamMode] = [ 'inline', 'stream_udp', 'stream_v4l2' ]
webcam_resolution : List[str] = [ '320x240', '640x480', '1280x720', '1920x1080', '2560x1440', '3840x2160' ]

View File

@@ -29,9 +29,10 @@ def listen() -> None:
def update_frame_processors(frame_processors : List[str]) -> Update:
clear_frame_processors_modules()
facefusion.globals.frame_processors = frame_processors
for frame_processor in facefusion.globals.frame_processors:
for frame_processor in frame_processors:
frame_processor_module = load_frame_processor_module(frame_processor)
frame_processor_module.pre_check()
if not frame_processor_module.pre_check():
return gradio.update()
return gradio.update(value = frame_processors, choices = sort_frame_processors(frame_processors))

View File

@@ -19,6 +19,8 @@ def render() -> None:
value.append('keep-temp')
if facefusion.globals.skip_audio:
value.append('skip-audio')
if facefusion.globals.skip_download:
value.append('skip-download')
SETTINGS_CHECKBOX_GROUP = gradio.Checkboxgroup(
label = wording.get('settings_checkbox_group_label'),
choices = choices.settings,
@@ -34,4 +36,5 @@ def update(settings : List[str]) -> Update:
facefusion.globals.keep_fps = 'keep-fps' in settings
facefusion.globals.keep_temp = 'keep-temp' in settings
facefusion.globals.skip_audio = 'skip-audio' in settings
facefusion.globals.skip_download = 'skip-download' in settings
return gradio.update(value = settings)

View File

@@ -1,22 +1,25 @@
import gradio
import facefusion.globals
from facefusion.uis.components import about, processors, execution, execution_thread_count, execution_queue_count, limit_resources, benchmark_settings, benchmark
from facefusion.utilities import conditional_download
def pre_check() -> bool:
conditional_download('.assets/examples',
[
'https://github.com/facefusion/facefusion-assets/releases/download/examples/source.jpg',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-240p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-360p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-540p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-720p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-1080p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-1440p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-2160p.mp4'
])
return True
if not facefusion.globals.skip_download:
conditional_download('.assets/examples',
[
'https://github.com/facefusion/facefusion-assets/releases/download/examples/source.jpg',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-240p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-360p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-540p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-720p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-1080p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-1440p.mp4',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-2160p.mp4'
])
return True
return False
def pre_render() -> bool: