Skip to content

Commit

Permalink
Merge pull request #1334 from kremnik/checkimagefirst
Browse files Browse the repository at this point in the history
Improvement: check image exists first
  • Loading branch information
serengil committed Sep 3, 2024
2 parents d3200c2 + b2e3d8d commit 9d15881
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deepface/modules/recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9d15881

Please sign in to comment.