Skip to content

Feature: add FaceRepository that does facial recognition#9

Merged
YifanZhang05 merged 5 commits intomainfrom
face-recognition
Nov 25, 2025
Merged

Feature: add FaceRepository that does facial recognition#9
YifanZhang05 merged 5 commits intomainfrom
face-recognition

Conversation

@YifanZhang05
Copy link
Contributor

Key features

FaceRepositoy.add_faces(self, namespace: str, chunk_id: str, faces: list[Face]):
add the given face embeddings to Pinecone under namespace, with chunk_id (which video chunk the embedded face appears in) and face_id (which face it is) in metadata.
returns a dictionary where key is face_id, value is number of times appearing

add_images(self, namespace: str, chunk_id: str, img_lst: list):
first detect all faces from each image in img_lst, then call add_faces
returns a dictionary where key is face_id, value is number of times appearing

@YifanZhang05
Copy link
Contributor Author

added chunk faces connector that stores face information for each chunk in modal dict

The dict structure looks like this:
{
chunk_id1: {face_id_1: 1, face_id_2: 1},
chunk_id2: {face_id_1: 2},
...
}

Copy link
Contributor

@eshaan-mehta eshaan-mehta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in terms of functionality, but should make another ticket for testing

@@ -0,0 +1,18 @@
import os
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should add more unit tests for each of the functions. It's ok for now, but you should add this as a next step as another PR

@YifanZhang05 YifanZhang05 merged commit 668d17c into main Nov 25, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants