Conversation
There was a problem hiding this comment.
test have to be in test folder if it doesnt exist create it and for the images dont do tis image_path = r"C:\Users\Lenovo\OneDrive\Desktop\MultiAI\multAI-back\app\images\image1.png" add iamge to the test file and test with it
| # 4. process each detected face | ||
| for face_index, face_embedding in enumerate(face_embeddings): | ||
|
|
||
| # create PhotoFace record |
There was a problem hiding this comment.
noo this is wrong logique here for each face_embedding search about the user tht have the face get his id and then use in the phoot_face record creation and dont creaet bbox=none fix it
| logger.warning("Failed to create photo face %s for photo %s", face_index, event.photo_id) | ||
| continue | ||
|
|
||
| # 5. compare against all enrolled users |
There was a problem hiding this comment.
this logiue must be in the db not in the service level so we can ensure durabilite
| SELECT id, face_embedding | ||
| FROM users | ||
| WHERE face_embedding IS NOT NULL | ||
| AND deleted_at IS NULL; No newline at end of file |
There was a problem hiding this comment.
refacotr this to use pgvector features
| INSERT INTO photo_approvals ( | ||
| photo_id, | ||
| user_id, | ||
| decision |
There was a problem hiding this comment.
and here just make sure tht decsision is enum in the service level
summary
implements a JetStream worker that processes group photos , detects all faces, matches them against enrolled users, and creates
PhotoFaceandPhotoApprovalrecords for each match.technical implementation
PHOTO_GROUP_PROCESSsubject toNatsSubjects.db/generated/photo_faces.pyquerier for creatingPhotoFacerecords.db/generated/photo_approvals.pyquerier for creatingPhotoApprovalrecords.list_users_with_embedding()query todb/generated/user.py.app/worker/photo_processor/schema/event.pyPydantic model for the JetStream event payload.app/worker/photo_processor/main.pyworker that:PhotoFacerecord per detected face.PhotoApprovalrecord withdecision=pendingfor each matched user.testing
PhotoGroupProcessWorker:PhotoFaceandPhotoApprovalfor matched users.PhotoApprovalfor unmatched users.