Implement green screen matting pipeline
This commit is contained in:
@@ -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")
|
||||
Reference in New Issue
Block a user