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,