Commit 7649865
fix: improve face clustering accuracy with similarity threshold and p… (#771)
* fix: improve face clustering accuracy with similarity threshold and post-clustering merge
- Added similarity_threshold parameter (0.85) to filter dissimilar faces before clustering
- Implemented post-clustering merge to combine duplicate clusters of same person
- Added quality filtering for embeddings (std and norm checks)
- Improved distance calculation using precomputed cosine distances
- Enhanced logging for better debugging and monitoring
- Prevents side-face false positives while maintaining high accuracy
* coderabbit minor changes
* coderabbit review minor changes
* fix: add NaN/zero-vector guards and format code
- Added _validate_embedding() to check for NaN/inf/zero vectors
- Guard against invalid embeddings in clustering and assignment
- Safe division in cosine distance calculations
- Format code with Black for lint compliance
---------
Co-authored-by: Keshav Sharma <keshavsharmaog@Keshavs-MacBook-Air.local>1 parent 917daff commit 7649865
File tree
4 files changed
+288
-39
lines changed- backend/app/utils
- docs/backend/backend_python
- frontend
4 files changed
+288
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
0 commit comments