mirror of
https://github.com/hacksider/Deep-Live-Cam.git
synced 2026-09-23 16:00:48 +02:00
fix: centralize OPENVINO_PROVIDER_CONFIG and log SystemExit
Address Sourcery review feedback on PR #1879: - Move OPENVINO_PROVIDER_CONFIG from _onnx_enhancer.py to platform_info.py (a leaf module with no modules.* imports), so the enhancer and face_swapper no longer import each other just to share a constant. _onnx_enhancer re-exports it; face_swapper now imports it at module top level instead of inside get_face_swapper(). - Narrow run.py's SystemExit handling: catch SystemExit separately and print a [startup] message so the failure is visible instead of being swallowed alongside ImportError/FileNotFoundError.
This commit is contained in:
@@ -42,6 +42,14 @@ HAS_COREML_PROVIDER: bool = "CoreMLExecutionProvider" in ONNX_PROVIDERS
|
||||
HAS_DML_PROVIDER: bool = "DmlExecutionProvider" in ONNX_PROVIDERS
|
||||
HAS_OPENVINO_PROVIDER: bool = "OpenVINOExecutionProvider" in ONNX_PROVIDERS
|
||||
|
||||
# OpenVINO execution-provider config shared by every ONNX session builder.
|
||||
# AUTO:GPU,NPU,CPU lets OpenVINO pick the best available device in priority
|
||||
# order (Intel GPU → NPU → CPU).
|
||||
OPENVINO_PROVIDER_CONFIG = (
|
||||
"OpenVINOExecutionProvider",
|
||||
{"device_type": "AUTO:GPU,NPU,CPU"},
|
||||
)
|
||||
|
||||
|
||||
def camera_backends() -> List[Tuple[int, int]]:
|
||||
"""Return an ordered list of ``(device_index, cv2_backend)`` attempts.
|
||||
|
||||
Reference in New Issue
Block a user