Merge pull request #1334 from kremnik/checkimagefirst

Improvement: check image exists first
This commit is contained in:
Sefik Ilkin Serengil 2024-09-03 09:56:11 +01:00 committed by GitHub
commit 9d15881ddb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -100,6 +100,10 @@ def find(
if not os.path.isdir(db_path): if not os.path.isdir(db_path):
raise ValueError(f"Passed path {db_path} does not exist!") 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 = [ file_parts = [
"ds", "ds",
"model", "model",