mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
AI: Improve Facial Recognition #2226
Labels
No labels
ai
android
api
auth
awesome
bug
bug
ci
cli
config
database
declined
deprecated
docker
docs 📚
documents
duplicate
easy
enhancement
enhancement
enhancement
epic
faces
feedback wanted
frontend
hacktoberfest
help wanted
idea
in-progress
incomplete
index
invalid
ios
labels
live
live
low-priority
macos
member-feature
metadata
mobile
nas
needs-analysis
no-coding-required
no-coding-required
observability
performance
places
please-test
plus-feature
priority
pro-feature
question
raspberry-pi
raw
released
released
released
research
resolved
security
sharing
tested
tests
third-party-issue
thumbnails
upgrade
upstream-issue
ux
vector
video
waiting
won't fix
won't fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/photoprism#2226
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @graciousgrey on GitHub (Dec 16, 2024).
As a user of PhotoPrism's face recognition feature, I would like to see a more capable model and vector database being used to improve performance and accuracy of matches.
Since the face detection and recognition functionality was first implemented in PhotoPrism, there has been a lot of progress in both models and database technology, for example:
Related Issues:
@theshadow27 commented on GitHub (Jan 2, 2025):
Questions for discussion/refinement:
markers_v)? Will this be a 'major' release that requires users to upgrade to the latest DB/install extensions in order to move to?matchwith vector distance search preserving all other logic, or redesign to leverage HNSW indexes with more advanced methods (HDBSCAN, temporal clustering, iterative learning, remove minimization/optimization). Incorporate a time dimension or metric to assist with children/aging?@lastzero commented on GitHub (Jan 13, 2025):
@theshadow27 Thanks for your questions!
@LiquidDegu commented on GitHub (Apr 29, 2025):
To be honest I think the face detection algorithm is a bigger problem than the recognition one. Would it be possible to work with this a liddle bit like the further ai models, where we could have a API and then force the snippets for the recognition back to the tenserflow algorithm?
@theshadow27 commented on GitHub (Jul 2, 2025):
While there is room for improvement in the face detection algorithm, the current clustering and brute force distance calculation approach is limiting on larger libraries and causing other issues (#3292) and blocking others (#1595, #1587). The multistep process of creating clusters and then assigning faces to them was an elegant solution before vector databases and GPU acceleration but is really showing it's age and needs to be replaced. For example, it's basically impossible with the current approach to use time, location, or even IMG_XXXX sequence number improve recognition accuracy because the marker has to be translated to a face (cluster) before it can be matched to a subject. The centroid of the face also shifts constantly, which can be highly problematic in parent-child or similar-sibling situations.
Not saying that the face detection doesn't need improvement, just keep the concerns separate. But I would suggest implementing this (vector-search) update before improving the detection; if suddenly 25% more faces are detected with the current algorithm, it would be very problematic, at least for me - I have 93k markers, so the full scan now takes 12+ hours even on high-end hardware (dual xeon, 48c, 256gb). Just my $0.02
@dror3go commented on GitHub (Dec 4, 2025):
After upgrading to the latest and greatest, I've decided to reset the faces un my library and start from scratch - since I had some issues with the existing face tags.
The new version, using the default face conconfiguration, while being much better at face detection, is less accurate on the clustering in my tests.
For example: my sister who appears in several hundreds of photos is not shown in the list of detected faces, while there are a few clusters containing different people: two friends who don't look alike (they both have a beard) share a cluster, and my dad and grandfather also share a single cluster.
I'm OK with sharing in private some relevant photos.
@lastzero commented on GitHub (Dec 7, 2025):
@dror3go In this release, we increased the
PHOTOPRISM_FACE_CLUSTER_RADIUSfrom 0.35 to 0.42. It can now be configured as shown below. Since we also decreased the value ofPHOTOPRISM_FACE_MATCH_DISTfrom 0.46 to 0.4, the maximum allowed distance for matching has increased slightly, from 0.77 to 0.42 + 0.4 = 0.82. This means that cluster sizes are more variable, and directly compared faces are less likely to match.👉 Since all variables are exposed via configuration, you can revert to the original settings if they work better for you.
We expect additional matching improvements once we replace the FaceNet embeddings with a different model. However, this will render the existing embeddings obsolete. Since our update already included a long list of major changes, we decided to save this change for next year. Additionally, this will require a database with vector support, meaning users will need to update their MariaDB, which is another breaking change.
Previous Available Config Options & Defaults
PIXELS(20-10000)QUALITYscore (1-100)PERCENT(1-100)PIXELS(20-10000)QUALITYscore of automatically clustered faces (1-100)NUMBERof faces forming a cluster core (1-100)DISTANCEof faces forming a cluster core (0.1-1.5)OFFSETfor matching faces with existing clusters (0.1-1.5)Config Options & Defaults in the New Release
NAME(auto, pigo, onnx)COUNT(0 uses half the available CPU cores)PIXELS(20-10000)QUALITYscore (1-100)ANGLEin radians (repeatable)PERCENT(1-100)PIXELS(20-10000)QUALITYscore of automatically clustered faces (1-100)NUMBERof faces forming a cluster core (1-100)DISTANCEof faces forming a cluster core (0.1-1.5)RADIUSaccepted for automatic matches (0.1-1.5)DISTANCE(0.01-1)DELTAappended to max match distances (0.001-0.1)OFFSETfor matching faces with existing clusters (0.1-1.5)@ptr727 commented on GitHub (Dec 14, 2025):
Question, is it possible to use an external AI vendor for face recognition, similar to e.g. the vision service? I'd gladly pay Google, OpenAI, etc. to get excellent face recognition of people that is currently poorly supported, specifically children, asian features, and pets. As is Immich does much better, but it lags in other areas.
@lastzero commented on GitHub (Dec 14, 2025):
We expect matching to improve once we replace the FaceNet embeddings with a different model. However, this will render the existing embeddings obsolete. Since our update already included a long list of major changes, we decided to save this change for next year. Additionally, this will require a database with vector support, meaning users will need to update their MariaDB, which introduces another breaking change. For more details, please see my comment above.
Note that manual face tagging is also in development and will be available in an upcoming release. Any help with testing will be much appreciated once we have merged this PR: