Feat: Let the user choose which faces to search with when the photo has several faces
Describe the feature
Problem When a photo has several people in it, face search uses only one of them. The other faces are ignored. The app does not tell the user which face it used, and the user cannot choose.
In my test I searched with a group photo of three people (A, B, C). Only C’s photos came back. A and B were in my gallery too, but they were not returned. Searching with a solo photo of one of them finds their photos (and the group photo), so matching itself works. The issue is that one face is picked silently.
Cause: perform_face_search in backend/app/utils/faceSearch.py uses result["embeddings"][0]. This is the first face the detector returns (highest detector confidence), not necessarily the largest or the one the user cares about.
Proposed feature Let the user choose which faces to search with:
- If the photo has one face, nothing changes.
- If it has several, show the photo with a box around each detected face.
- The user can deselect faces they do not want (for example blurry ones). Deselected faces are greyed out and are not used, because blurry faces can match the wrong people.
- If more than one face stays selected, the user chooses whether to match any of them or all of them together, as in the existing multi-person search.
- The results page shows photos for the selected faces.
Implementation idea One PR (can be split into backend and frontend if the maintainers prefer):
- Backend: an endpoint that returns the faces detected in a photo (boxes and confidence), and a face-search option that takes the chosen faces and a match mode. FaceDetector.detect_faces already returns aligned boxes and embeddings, and it uses whichever YOLO face model the user has active, so it can be reused.
- Frontend: a face picker dialog shown before the search, reusing the style of MultiPersonSearchDialog. Results stay in the face mode of the existing SearchResults page.
This builds on #1616, which moves face search results into the SearchResults page.
Add ScreenShots
Screen recording of the problem:
https://drive.google.com/file/d/1ubn0YCEihnFEpLZNYJt0SJ-ozOs9vze3/view?usp=sharing
Record
- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue
👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)
⚠️ Potential Duplicate Issue (Semantic Match)
This issue appears semantically similar to the following issues in AOSSIE-Org/PictoPy:
-
BUG: face search misses everyone but the first face in a group photo (#1583, closed) https://github.com/AOSSIE-Org/PictoPy/issues/1583 Similarity: 79.3%
-
UI Based Multi-Person Face Image Search with Ranked Results (#1302, closed) https://github.com/AOSSIE-Org/PictoPy/issues/1302 Similarity: 66%
-
BUG: Face clusters show fewer photos than face search for the same person (#1164, open) https://github.com/AOSSIE-Org/PictoPy/issues/1164 Similarity: 63.1%
Please review before proceeding.
Link your account with Gitcord
Thanks for opening this issue, @JIturiDashami!
To receive Discord notifications and contributor tracking for this organization:
- Join Discord: https://discord.gg/hjUhu33uAn
- In Discord, run
/link JIturiDashami - Paste the verification code into your GitHub bio (or a public gist)
- Click Verify in Discord (or run
/verify-link JIturiDashami)
Once linked, Gitcord can notify you about assignments, mentions, and more.
— Posted by Gitcord
@JIturiDashami can i work on this issue?
@RitikaSen27 I have started working on this issue ..so please can you check other issues, Thanks for understanding!!
@JIturiDashami okay alright