From 2344ca2c3a3b489e59210280fedbf10ef7036fab Mon Sep 17 00:00:00 2001 From: henryruhs Date: Mon, 1 Apr 2024 23:55:20 +0200 Subject: [PATCH] Improve model file handling part2 --- facefusion/processors/frame/modules/face_enhancer.py | 8 ++++---- facefusion/processors/frame/modules/face_swapper.py | 8 ++++---- facefusion/processors/frame/modules/frame_colorizer.py | 8 ++++---- facefusion/processors/frame/modules/frame_enhancer.py | 8 ++++---- facefusion/processors/frame/modules/lip_syncer.py | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/facefusion/processors/frame/modules/face_enhancer.py b/facefusion/processors/frame/modules/face_enhancer.py index af89c335..998ecf09 100755 --- a/facefusion/processors/frame/modules/face_enhancer.py +++ b/facefusion/processors/frame/modules/face_enhancer.py @@ -160,12 +160,12 @@ def post_check() -> bool: model_url = get_options('model').get('url') model_path = get_options('model').get('path') - if facefusion.globals.skip_download and not is_file(model_path): - logger.error(wording.get('model_file_not_present') + wording.get('exclamation_mark'), NAME) - return False - if not is_download_done(model_url, model_path): + if not facefusion.globals.skip_download and not is_download_done(model_url, model_path): logger.error(wording.get('model_download_not_done') + wording.get('exclamation_mark'), NAME) return False + if not is_file(model_path): + logger.error(wording.get('model_file_not_present') + wording.get('exclamation_mark'), NAME) + return False return True diff --git a/facefusion/processors/frame/modules/face_swapper.py b/facefusion/processors/frame/modules/face_swapper.py index 0d440a57..90875d64 100755 --- a/facefusion/processors/frame/modules/face_swapper.py +++ b/facefusion/processors/frame/modules/face_swapper.py @@ -188,12 +188,12 @@ def post_check() -> bool: model_url = get_options('model').get('url') model_path = get_options('model').get('path') - if facefusion.globals.skip_download and not is_file(model_path): - logger.error(wording.get('model_file_not_present') + wording.get('exclamation_mark'), NAME) - return False - if not is_download_done(model_url, model_path): + if not facefusion.globals.skip_download and not is_download_done(model_url, model_path): logger.error(wording.get('model_download_not_done') + wording.get('exclamation_mark'), NAME) return False + if not is_file(model_path): + logger.error(wording.get('model_file_not_present') + wording.get('exclamation_mark'), NAME) + return False return True diff --git a/facefusion/processors/frame/modules/frame_colorizer.py b/facefusion/processors/frame/modules/frame_colorizer.py index 49691701..51760ee5 100644 --- a/facefusion/processors/frame/modules/frame_colorizer.py +++ b/facefusion/processors/frame/modules/frame_colorizer.py @@ -114,12 +114,12 @@ def post_check() -> bool: model_url = get_options('model').get('url') model_path = get_options('model').get('path') - if facefusion.globals.skip_download and not is_file(model_path): - logger.error(wording.get('model_file_not_present') + wording.get('exclamation_mark'), NAME) - return False - if not is_download_done(model_url, model_path): + if not facefusion.globals.skip_download and not is_download_done(model_url, model_path): logger.error(wording.get('model_download_not_done') + wording.get('exclamation_mark'), NAME) return False + if not is_file(model_path): + logger.error(wording.get('model_file_not_present') + wording.get('exclamation_mark'), NAME) + return False return True diff --git a/facefusion/processors/frame/modules/frame_enhancer.py b/facefusion/processors/frame/modules/frame_enhancer.py index f631cbf6..2b9eea32 100644 --- a/facefusion/processors/frame/modules/frame_enhancer.py +++ b/facefusion/processors/frame/modules/frame_enhancer.py @@ -135,12 +135,12 @@ def post_check() -> bool: model_url = get_options('model').get('url') model_path = get_options('model').get('path') - if facefusion.globals.skip_download and not is_file(model_path): - logger.error(wording.get('model_file_not_present') + wording.get('exclamation_mark'), NAME) - return False - if not is_download_done(model_url, model_path): + if not facefusion.globals.skip_download and not is_download_done(model_url, model_path): logger.error(wording.get('model_download_not_done') + wording.get('exclamation_mark'), NAME) return False + if not is_file(model_path): + logger.error(wording.get('model_file_not_present') + wording.get('exclamation_mark'), NAME) + return False return True diff --git a/facefusion/processors/frame/modules/lip_syncer.py b/facefusion/processors/frame/modules/lip_syncer.py index f29457ec..c502531e 100755 --- a/facefusion/processors/frame/modules/lip_syncer.py +++ b/facefusion/processors/frame/modules/lip_syncer.py @@ -101,12 +101,12 @@ def post_check() -> bool: model_url = get_options('model').get('url') model_path = get_options('model').get('path') - if facefusion.globals.skip_download and not is_file(model_path): - logger.error(wording.get('model_file_not_present') + wording.get('exclamation_mark'), NAME) - return False - if not is_download_done(model_url, model_path): + if not facefusion.globals.skip_download and not is_download_done(model_url, model_path): logger.error(wording.get('model_download_not_done') + wording.get('exclamation_mark'), NAME) return False + if not is_file(model_path): + logger.error(wording.get('model_file_not_present') + wording.get('exclamation_mark'), NAME) + return False return True