From cdb7bd63578b875d039d94f41df67aea0f3359d5 Mon Sep 17 00:00:00 2001 From: Dowon Date: Sat, 3 Aug 2024 12:57:09 +0900 Subject: [PATCH] fix: suppress mediapipe error --- adetailer/mediapipe.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adetailer/mediapipe.py b/adetailer/mediapipe.py index 25c6900..b05fa00 100644 --- a/adetailer/mediapipe.py +++ b/adetailer/mediapipe.py @@ -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)