mirror of
https://github.com/serengil/deepface.git
synced 2025-06-06 11:35:21 +00:00
[update] one-line checking
This commit is contained in:
parent
0f65a8765e
commit
bb820a7ef4
@ -131,10 +131,8 @@ def analyze(
|
||||
)
|
||||
|
||||
# Anti-spoofing check
|
||||
if anti_spoofing:
|
||||
for img_obj in img_objs:
|
||||
if img_obj.get("is_real", True) is False:
|
||||
raise ValueError("Spoof detected in the given image.")
|
||||
if anti_spoofing and any(img_obj.get("is_real", True) is False for img_obj in img_objs):
|
||||
raise ValueError("Spoof detected in the given image.")
|
||||
|
||||
# Prepare the input for the model
|
||||
valid_faces = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user