Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #77 from LimaoC/mitch-robuster-register
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellJC authored Oct 6, 2024
2 parents 337156f + d4c022f commit 9a04a16
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/models/face_recognition/recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ def register_faces(user_id: int, faces: list[np.ndarray]) -> int:
face_embedding = all_faces_embed[0]
face_embeddings.append(face_embedding)

# Ensure that all images contain the same face
matches = face_recognition.compare_faces(face_embeddings[1:], face_embeddings[0])
if not all(matches):
return Status.TOO_MANY_FACES.value

register_face_embeddings(user_id, face_embeddings)

return Status.OK.value

0 comments on commit 9a04a16

Please sign in to comment.