Skip to content

Feat/group photo processor worker#37

Draft
maya-ots wants to merge 9 commits intodevelopfrom
feat/group-photo-processor-worker
Draft

Feat/group photo processor worker#37
maya-ots wants to merge 9 commits intodevelopfrom
feat/group-photo-processor-worker

Conversation

@maya-ots
Copy link
Collaborator

summary

implements a JetStream worker that processes group photos , detects all faces, matches them against enrolled users, and creates PhotoFace and PhotoApproval records for each match.

technical implementation

  • added PHOTO_GROUP_PROCESS subject to NatsSubjects.
  • created db/generated/photo_faces.py querier for creating PhotoFace records.
  • created db/generated/photo_approvals.py querier for creating PhotoApproval records.
  • added list_users_with_embedding() query to db/generated/user.py.
  • created app/worker/photo_processor/schema/event.py Pydantic model for the JetStream event payload.
  • created app/worker/photo_processor/main.py worker that:
    • fetches photo from MinIO.
    • detects all faces in the photo and computes embeddings.
    • compares each embedding against all enrolled users using cosine similarity.
    • creates a PhotoFace record per detected face.
    • creates a PhotoApproval record with decision=pending for each matched user.

testing

  • Added unit tests for PhotoGroupProcessWorker :
    • handles no faces detected (exits early).
    • creates PhotoFace and PhotoApproval for matched users.
    • does not create PhotoApproval for unmatched users.

@maya-ots maya-ots requested a review from wailbentafat March 26, 2026 02:40
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.

1 participant