From 2b1af42d06071b889a9bbb5c967c4455f8de8434 Mon Sep 17 00:00:00 2001 From: Accusys Date: Wed, 12 Aug 2026 05:19:54 +0800 Subject: [PATCH] fix: keep all traces in face clustering (remove min_faces=4 cutoff) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Large files (>1000 traces) used min_faces_per_trace=4, silently dropping short traces (<=3 face points) from dedup. For 44c37c this excluded 484/1430 traces (34%) — walk-ons and passers-by never got a person label. Now use min_faces=1 constant; noise is handled by the confidence>=0.5 filter in cluster_by_trace instead of dropping short appearances. Result on 44c37c: 1430/1430 traces clustered, 21717/21717 faces assigned, clusters 104 -> 203. --- scripts/face_clustering_processor.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/face_clustering_processor.py b/scripts/face_clustering_processor.py index 38ee3335..ccd96a8a 100644 --- a/scripts/face_clustering_processor.py +++ b/scripts/face_clustering_processor.py @@ -430,12 +430,14 @@ def main(): if tid is not None and tid >= 0: unique_trace_ids.add(tid) - # Adaptive threshold: only filter noise when trace count is large - # For small files (<=1000 traces), keep all traces for maximum recall - # For large files (>1000 traces), filter out single-face noise - min_faces = 4 if len(unique_trace_ids) > 1000 else 1 + # Keep all traces for maximum recall. Noise is handled by the + # confidence_threshold filter in cluster_by_trace (0.5), not by + # dropping short traces — short appearances (walk-ons, passers-by) + # are real people and must stay in the dedup pool, even for + # large files with many faces. + min_faces = 1 print( - f"[CONFIG] unique_traces={len(unique_trace_ids)}, min_faces_per_trace={min_faces} (adaptive)" + f"[CONFIG] unique_traces={len(unique_trace_ids)}, min_faces_per_trace={min_faces}" ) trace_embeddings, traces = cluster_by_trace(