Use latest onnxruntime and enable model cache for CoreML

This commit is contained in:
henryruhs
2025-03-12 09:42:30 +01:00
parent 096d31cad6
commit bb5504c7a4
3 changed files with 8 additions and 5 deletions

View File

@@ -60,7 +60,10 @@ def create_inference_session_providers(execution_device_id : str, execution_prov
'precision': 'FP32' 'precision': 'FP32'
})) }))
if execution_provider == 'coreml': if execution_provider == 'coreml':
inference_session_providers.append(facefusion.choices.execution_provider_set.get(execution_provider)) inference_session_providers.append((facefusion.choices.execution_provider_set.get(execution_provider),
{
'ModelCacheDirectory': '.caches'
}))
if 'cpu' in execution_providers: if 'cpu' in execution_providers:
inference_session_providers.append(facefusion.choices.execution_provider_set.get('cpu')) inference_session_providers.append(facefusion.choices.execution_provider_set.get('cpu'))

View File

@@ -10,10 +10,10 @@ from facefusion.common_helper import is_linux, is_windows
ONNXRUNTIME_SET =\ ONNXRUNTIME_SET =\
{ {
'default': ('onnxruntime', '1.20.1') 'default': ('onnxruntime', '1.21.0')
} }
if is_windows() or is_linux(): if is_windows() or is_linux():
ONNXRUNTIME_SET['cuda'] = ('onnxruntime-gpu', '1.20.1') ONNXRUNTIME_SET['cuda'] = ('onnxruntime-gpu', '1.21.0')
ONNXRUNTIME_SET['openvino'] = ('onnxruntime-openvino', '1.20.0') ONNXRUNTIME_SET['openvino'] = ('onnxruntime-openvino', '1.20.0')
if is_windows(): if is_windows():
ONNXRUNTIME_SET['directml'] = ('onnxruntime-directml', '1.17.3') ONNXRUNTIME_SET['directml'] = ('onnxruntime-directml', '1.17.3')
@@ -51,7 +51,7 @@ def run(program : ArgumentParser) -> None:
if python_id in [ 'cp310', 'cp312' ]: if python_id in [ 'cp310', 'cp312' ]:
wheel_name = 'onnxruntime_rocm-' + onnxruntime_version + '-' + python_id + '-' + python_id + '-linux_x86_64.whl' wheel_name = 'onnxruntime_rocm-' + onnxruntime_version + '-' + python_id + '-' + python_id + '-linux_x86_64.whl'
wheel_url = 'https://repo.radeon.com/rocm/manylinux/rocm-rel-6.3.1/' + wheel_name wheel_url = 'https://repo.radeon.com/rocm/manylinux/rocm-rel-6.3.4/' + wheel_name
subprocess.call([ shutil.which('pip'), 'install', wheel_url, '--force-reinstall' ]) subprocess.call([ shutil.which('pip'), 'install', wheel_url, '--force-reinstall' ])
else: else:
subprocess.call([ shutil.which('pip'), 'install', onnxruntime_name + '==' + onnxruntime_version, '--force-reinstall' ]) subprocess.call([ shutil.which('pip'), 'install', onnxruntime_name + '==' + onnxruntime_version, '--force-reinstall' ])

View File

@@ -2,7 +2,7 @@ gradio==5.20.0
gradio-rangeslider==0.0.8 gradio-rangeslider==0.0.8
numpy==2.2.3 numpy==2.2.3
onnx==1.17.0 onnx==1.17.0
onnxruntime==1.20.1 onnxruntime==1.21.0
opencv-python==4.11.0.86 opencv-python==4.11.0.86
psutil==7.0.0 psutil==7.0.0
tqdm==4.67.1 tqdm==4.67.1