From 98a5111d533ae4d1aad524f6efcacbb05e3250cc Mon Sep 17 00:00:00 2001 From: henryruhs Date: Tue, 30 May 2023 21:47:59 +0200 Subject: [PATCH] Undo: Resolve absolute model path --- core/processor.py | 3 +-- run.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/processor.py b/core/processor.py index ad1e183..f1c33e5 100644 --- a/core/processor.py +++ b/core/processor.py @@ -11,8 +11,7 @@ FACE_SWAPPER = None def get_face_swapper(): global FACE_SWAPPER if FACE_SWAPPER is None: - model_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'inswapper_128.onnx') - FACE_SWAPPER = insightface.model_zoo.get_model(model_path) + FACE_SWAPPER = insightface.model_zoo.get_model('inswapper_128.onnx') return FACE_SWAPPER diff --git a/run.py b/run.py index 6aaa4a8..4878164 100644 --- a/run.py +++ b/run.py @@ -61,8 +61,7 @@ def pre_check(): quit(f'Python version is not supported - please upgrade to 3.8 or higher') if not shutil.which('ffmpeg'): quit('ffmpeg is not installed!') - model_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'inswapper_128.onnx') - if not os.path.isfile(model_path): + if not os.path.isfile('inswapper_128.onnx'): quit('File "inswapper_128.onnx" does not exist!') if '--gpu' in sys.argv: CUDA_VERSION = torch.version.cuda