fix: suppress mediapipe error

This commit is contained in:
Dowon
2024-08-03 12:57:09 +09:00
parent b700b354d5
commit cdb7bd6357

View File

@@ -21,7 +21,10 @@ def mediapipe_predict(
}
if model_type in mapping:
func = mapping[model_type]
return func(image, confidence)
try:
return func(image, confidence)
except Exception:
return PredictOutput()
msg = f"[-] ADetailer: Invalid mediapipe model type: {model_type}, Available: {list(mapping.keys())!r}"
raise RuntimeError(msg)