From 1bcc065a11569141836e59f41305ba1ddd7e50d1 Mon Sep 17 00:00:00 2001 From: haddyadnan Date: Thu, 19 Oct 2023 12:55:58 -0700 Subject: [PATCH] refactor try block --- deepface/detectors/FastMtcnnWrapper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deepface/detectors/FastMtcnnWrapper.py b/deepface/detectors/FastMtcnnWrapper.py index d9b0b20..20461a3 100644 --- a/deepface/detectors/FastMtcnnWrapper.py +++ b/deepface/detectors/FastMtcnnWrapper.py @@ -8,9 +8,9 @@ def build_model(): # Optional dependency try: from facenet_pytorch import MTCNN as fast_mtcnn - except ModuleNotFoundError: - print("This is an optional detector, ensure the library is installed. \ - Please install using 'pip install facenet-pytorch' ") + except ModuleNotFoundError as e: + raise ImportError("This is an optional detector, ensure the library is installed. \ + Please install using 'pip install facenet-pytorch' ") from e face_detector = fast_mtcnn(image_size=160,