#5811·photoprism

People: same person assigned twice in one photo (no one-person-once constraint)

Author: cheercCreated Sep 9, 2026Updated Sep 9, 2026

Expected Behavior

One physical person appears at most once per photo (excluding the rare "photo of a photo" case). When two face markers in the same photo are both matched to the same subject, PhotoPrism should keep only the best one (or ask the user to resolve the conflict) instead of silently assigning the same name twice.

What Happened

In a library of ~630 family/school JPEGs, 3 group photos ended up with 2-4 markers all assigned to the same named person (call them "Person A"):

photo same-name markers coordinates (x, y, w, h) score / face_dist
group photo 1 4 (0.887,0.111), (0.886,0.304), (0.179,0.217), (0.053,0.341) 80-86 / 0.56-0.59
group photo 2 2 (0.42,0.264), (0.70,0.172) 62-90 / n/a
group photo 3 2 (0.656,0.585), (0.563,0.448) 74-83 / 0.44-0.59

Two distinct causes observed in the marker rows:

  1. Near-duplicate detection boxes - e.g. (0.887,0.111) vs (0.886,0.304): adjacent/overlapping boxes on (likely) the same face, both passing the similarity threshold and both linked to the same face cluster. Looks like NMS did not merge them before subject matching.
  2. Small-face misassignment - boxes as small as w=0.04, score in the low 60s, at the edge of group photos, matched to the named person with face_dist approx 0.56-0.70. These are model-level false positives, but the lack of a one-person-once guard lets them stand unchallenged next to the correct marker.

Why It Matters

  • person:"Name" search returns the photo once, so the duplicate is invisible in normal use; it only surfaces in the face editor sidebar, where the same name appears twice on one photo and confuses the user.
  • Manual cleanup works (reject one marker, clustering updates), but new imports reintroduce the same pattern, so it is a recurring tax.
  • Downstream export tooling has to defensively de-duplicate per photo.

Suggested Fix (for discussion)

  • After subject matching, enforce at most one marker per (photo, subject). Keep the marker with the lowest face_dist (or highest score) and either unassign or flag the others for review.
  • Optionally merge near-duplicate boxes (high IoU) before matching, so the same face does not produce two candidates in the first place.

Environment

  • PhotoPrism version: 260728-bbde8f452-Linux-ARM64-Plus (official photoprism/photoprism:latest, linux/arm64, SQLite, read-only originals)
  • Library: ~630 JPEGs, ~1400 valid face markers, a handful of face clusters
  • Detection found the faces correctly; the issue is purely that two markers in one photo share one subj_uid.

Related

  • #4669 (AI: Improve Facial Recognition) - model-level accuracy; this issue is about the missing one-person-once constraint regardless of model quality.
  • #1587 (facial recognition for young children) - same library profile (kindergarten group photos), small/occluded faces misassigned more often.