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

feat: added function for resetting all registered user faces #71

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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