People: Name new face clusters when all matches agree
As a user, I want new face clusters to be named automatically when the faces already recognized in them all belong to the same person, so that I don't have to confirm the same person again and their other photos are found as well.
Summary
When face recognition assigns people to individual faces, those faces can end up in a new, still unnamed cluster. Such clusters currently stay unnamed, even when every recognized face in them names the same person, so they keep showing up among the new faces and the person's remaining photos in the cluster are not recognized.
With this change, a face recognition run names a new cluster after that person when the evidence clearly supports it:
- enough faces in the cluster were recognized automatically, and all of them name the same person;
- these faces make up at least half of the cluster;
- no face in the cluster was named manually.
The cluster's unnamed faces are then assigned to the person, and the cluster no longer appears among the new faces. Clusters whose recognized faces disagree, or where a person was assigned manually, stay as they are. Face names imported from metadata (with PHOTOPRISM_XMP_FACES enabled) can count toward this as well, as described under Technical Considerations and Open Questions.
Technical Considerations
- The minimum number of named markers per cluster SHOULD follow the
face-cluster-coresetting (face.ClusterCore), so a cluster is only named from as much evidence as it takes to form one. - The cluster SHOULD be named with
Face.SetSubjectUID(internal/entity/face.go), which also assigns its unnamed markers, and itsface_srcMUST stay empty, so the name counts as automatic like other names found by the matcher. - A marker named from XMP metadata counts like an automatically named one only when its person was named by hand (a marker with a source other than automatic or XMP) or has the Verified flag set (
subjects.verified, the "Verified" checkbox when editing a person). Any other XMP name neither counts nor keeps the cluster unnamed, but its face still counts toward the cluster size for the majority. The same thresholds apply to all counted names together. - As for other automatically named clusters, a default
photoprism faces resetremoves the name, and naming a single marker manually changes only that marker. - The check SHOULD run once per face recognition run in
Faces.Start(internal/photoprism/faces.go), after matching, with one grouped query rather than a query per file or marker. - Collision handling, optimize/merge, and the face audit (
internal/photoprism/faces_audit.go) MUST keep working as before.
Open Questions
- Should a face name from metadata that doesn't match a person who was named by hand or marked as "Verified" keep a cluster from being named? Face regions imported from XMP metadata (with
PHOTOPRISM_XMP_FACESenabled) carry names given outside PhotoPrism, so small differences are likely, e.g. "Micha", "michael", "M. Mayer" or "Michael R. Mayer" for a person named "Michael Mayer" in the library. The working assumption is that such a name does not block naming: a metadata name counts like an automatically recognized face when it matches a person who was named by hand or marked as "Verified", other metadata names are ignored, and a manually assigned name still keeps the cluster unnamed. Please confirm or adjust this when testing. - Should face names from metadata be able to name a cluster on their own? With this change, metadata names that match a person who was named by hand or marked as "Verified" can name a cluster without automatic recognition agreeing, as long as they meet the same thresholds. This helps libraries migrated from software that stored faces in XMP metadata, where no faces have been recognized automatically yet. Should this stay, or should automatic recognition have to find the person in the cluster at least once before metadata names count?
Acceptance Criteria
- MUST name a new face cluster when enough automatically recognized faces in it, making up at least half of the cluster, all name the same person.
- MUST assign the cluster's unnamed faces to that person.
- MUST leave clusters unchanged whose recognized faces name different people, are too few or a minority, or that contain a manually assigned name.
- MUST treat the new name as automatic, so a default
photoprism faces resetremoves it. - MUST NOT change how manually assigned names are kept.
- SHOULD count a face name imported from metadata that matches a person who was named by hand or marked as "Verified" like a recognized face, and SHOULD NOT let any other metadata name keep a cluster unnamed (see Open Questions).
- SHOULD list clusters that qualify in
photoprism faces audit. - SHOULD not measurably slow down indexing or face recognition runs.
- MAY let a manual name replace an automatically assigned cluster name in a later change.
Source: photoprism/photoprism