diff --git a/deepface/modules/detection.py b/deepface/modules/detection.py index fc9ef6c..a1c97b6 100644 --- a/deepface/modules/detection.py +++ b/deepface/modules/detection.py @@ -76,6 +76,9 @@ def extract_faces( # img might be path, base64 or numpy array. Convert it to numpy whatever it is. img, img_name = preprocessing.load_image(img_path) + if img is None: + raise ValueError(f"Exception while loading {img_name}") + base_region = FacialAreaRegion(x=0, y=0, w=img.shape[1], h=img.shape[0], confidence=0) if detector_backend == "skip":