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 #71 from LimaoC/mitch-reset-faces
Browse files Browse the repository at this point in the history
feat: added function for resetting all registered user faces
  • Loading branch information
MitchellJC authored Oct 4, 2024
2 parents 77cbc27 + aaa5a6a commit f38df2d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/data/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ def register_face_embeddings(user_id: int, face_embeddings: list[np.ndarray]) ->
np.save(embedding_path, stacked_faces)


def reset_registered_face_embeddings() -> None:
"""Clear all registered user faces."""
with resources.as_file(FACES_FOLDER) as faces_folder:
for user_embeddings_path in faces_folder.iterdir():
user_embeddings_path.unlink()


def iter_face_embeddings() -> Iterator[tuple[int, list[np.ndarray]]]:
"""
Returns:
Expand Down

0 comments on commit f38df2d

Please sign in to comment.