From b2e3d8d21ab884c6201b8cecaeed3b9998e50262 Mon Sep 17 00:00:00 2001 From: kremnik Date: Mon, 2 Sep 2024 18:20:51 +0300 Subject: [PATCH] Improvement: check image exists first --- deepface/modules/recognition.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deepface/modules/recognition.py b/deepface/modules/recognition.py index baa50eda..799dfbca 100644 --- a/deepface/modules/recognition.py +++ b/deepface/modules/recognition.py @@ -100,6 +100,10 @@ def find( if not os.path.isdir(db_path): raise ValueError(f"Passed path {db_path} does not exist!") + img, _ = image_utils.load_image(img_path) + if img is None: + raise ValueError(f"Passed image path {img_path} does not exist!") + file_parts = [ "ds", "model",