mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
throw meaningful error if an img_path cannot be read
This commit is contained in:
parent
d3f7cab119
commit
a9cb7b96e3
@ -85,7 +85,7 @@ def verify(
|
||||
model: FacialRecognition = modeling.build_model(model_name)
|
||||
target_size = model.input_shape
|
||||
|
||||
# img pairs might have many faces
|
||||
try:
|
||||
img1_objs = detection.extract_faces(
|
||||
img_path=img1_path,
|
||||
target_size=target_size,
|
||||
@ -95,7 +95,10 @@ def verify(
|
||||
align=align,
|
||||
expand_percentage=expand_percentage,
|
||||
)
|
||||
except ValueError as err:
|
||||
raise ValueError("Exception while processing img1_path") from err
|
||||
|
||||
try:
|
||||
img2_objs = detection.extract_faces(
|
||||
img_path=img2_path,
|
||||
target_size=target_size,
|
||||
@ -105,6 +108,8 @@ def verify(
|
||||
align=align,
|
||||
expand_percentage=expand_percentage,
|
||||
)
|
||||
except ValueError as err:
|
||||
raise ValueError("Exception while processing img2_path") from err
|
||||
# --------------------------------
|
||||
distances = []
|
||||
regions = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user