Skip to content

Industry leading face manipulation platform

fix coreml under recent macos

henryruhs72470819a037
diff --git a/facefusion/content_analyser.py b/facefusion/content_analyser.py
index 6caf43fe..c8edae90 100644
--- a/facefusion/content_analyser.py
+++ b/facefusion/content_analyser.py
@@ -1,14 +1,17 @@
from functools import lru_cache
-from typing import Tuple
+from typing import List, Tuple
import numpy
from tqdm import tqdm
+import facefusion.choices
from facefusion import inference_manager, state_manager, translator, video_manager
+from facefusion.common_helper import is_macos
from facefusion.download import conditional_download_hashes, conditional_download_sources, resolve_download_url
+from facefusion.execution import has_execution_provider
from facefusion.filesystem import resolve_relative_path
from facefusion.thread_helper import conditional_thread_semaphore
-from facefusion.types import Detection, DownloadScope, DownloadSet, Fps, InferencePool, ModelSet, VisionFrame
+from facefusion.types import Detection, DownloadScope, DownloadSet, Fps, InferencePool, InferenceProvider, ModelSet, VisionFrame
from facefusion.vision import detect_video_fps, fit_contain_frame, is_vision_frame, read_image
STREAM_COUNTER = 0
@@ -117,6 +120,13 @@ def clear_inference_pool() -> None:
inference_manager.clear_inference_pool(__name__, model_names)
+def override_inference_providers() -> List[InferenceProvider]:
+ if is_macos() and has_execution_provider('coreml'):
+ return [ facefusion.choices.execution_provider_set.get('cpu') ]
+
+ return []
+
+
def collect_model_downloads() -> Tuple[DownloadSet, DownloadSet]:
model_set = create_static_model_set('full')
model_hash_set = {}
diff --git a/facefusion/core.py b/facefusion/core.py
index 0ea7b062..114b83b6 100755
--- a/facefusion/core.py
+++ b/facefusion/core.py
@@ -100,7 +100,7 @@ def pre_check() -> bool:
def common_pre_check() -> bool:
content_analyser_content = inspect.getsource(content_analyser).encode()
- return hash_helper.create_hash(content_analyser_content) == '3c6ce25e'
+ return hash_helper.create_hash(content_analyser_content) == '068a6158'
def processors_pre_check() -> bool:
diff --git a/facefusion/installer.py b/facefusion/installer.py
index cdbc81b4..9604414d 100644
--- a/facefusion/installer.py
+++ b/facefusion/installer.py
@@ -19,7 +19,7 @@ LOCALES =\
}
ONNXRUNTIME_SET =\
{
- 'default': ('onnxruntime', '1.29.0')
+ 'default': ('onnxruntime', '1.30.0')
}
if is_windows() or is_linux():
ONNXRUNTIME_SET['cuda@12'] = ('onnxruntime-gpu', '1.24.4')