Implement green screen matting pipeline

This commit is contained in:
Codex
2026-06-30 14:14:15 +08:00
parent 4d2a2015fe
commit 8fc53925e0
17 changed files with 896 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
from __future__ import annotations
def require_module(module_name: str, install_hint: str):
try:
return __import__(module_name)
except ModuleNotFoundError as exc:
if exc.name == module_name:
raise RuntimeError(
f"Missing dependency '{module_name}'. Install it with: {install_hint}"
) from exc
raise
def require_cv2():
return require_module("cv2", "pip install opencv-python")