fix: add min_capture_quality to FaceFilterSettings + trace profile fixes

- Add min_capture_quality to FaceFilterSettings (file_profile.rs)
- Fix store_traced_faces.py: load embeddings from Qdrant with_vector=True
- Fix face_tracker.py: force new traces when frame_gap > 30
- Fix backfill_trace_profiles.py: key_frame select=eq(n,N), bbox scaling, best_frame
- Add best_frame to FaceTraceProfile (Rust + Python)
- Fix min_capture_quality persistence in file-profile API
This commit is contained in:
Accusys
2026-08-13 10:12:21 +08:00
parent 71172fa354
commit 39e9ce4c3b
25 changed files with 723 additions and 131 deletions
+37 -2
View File
@@ -137,11 +137,46 @@ def match_faces(
if not previous_faces:
return {i: -1 for i in range(len(current_faces))}
# If a scene cut exists between prev and current frame, force all new traces
# If frame gap is too large, force new traces (likely crossed multiple scenes)
if frame_gap is not None and frame_gap > 30:
return {i: -1 for i in range(len(current_faces))}
# If a scene cut exists between prev and current frame, only continue
# traces for faces matching the previous frame with high IoU (same person
# in the same position across the cut); unmatched faces get new traces.
if cut_boundaries and prev_frame is not None and curr_frame is not None:
for cf in cut_boundaries:
if prev_frame < cf <= curr_frame:
return {i: -1 for i in range(len(current_faces))}
matches = {}
used_prev = set()
for curr_idx, curr_face in enumerate(current_faces):
best_prev_idx = -1
best_iou = 0.0
curr_bbox = {
"x": curr_face["x"],
"y": curr_face["y"],
"width": curr_face["width"],
"height": curr_face["height"],
}
for prev_idx, prev_face in enumerate(previous_faces):
if prev_idx in used_prev:
continue
prev_bbox = {
"x": prev_face["x"],
"y": prev_face["y"],
"width": prev_face["width"],
"height": prev_face["height"],
}
iou = calculate_bbox_iou(curr_bbox, prev_bbox)
if iou > best_iou:
best_iou = iou
best_prev_idx = prev_idx
if best_prev_idx >= 0 and best_iou > 0.5:
matches[curr_idx] = best_prev_idx
used_prev.add(best_prev_idx)
else:
matches[curr_idx] = -1
return matches
matches = {}
used_prev = set()
+1
View File
@@ -126,6 +126,7 @@ def push_face_embeddings_batch(file_uuid: str, faces: list, publisher=None) -> i
"trace_id": face.get("trace_id", 0),
"bbox": face["bbox"],
"confidence": face.get("confidence", 0.5),
"capture_quality": face.get("capture_quality", 0.0),
"identity_id": None,
"identity_uuid": None,
"stranger_id": None,