bug fix in case of load image returns none

This commit is contained in:
Sefik Ilkin Serengil 2024-02-24 15:35:26 +00:00
parent ab38a1fcf7
commit 0d18a7c2df

View File

@ -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":