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
+12 -1
View File
@@ -42,7 +42,8 @@ pub async fn upsert_trace_profile(
// Use LEFT JOIN to get tkg_nodes data for backfilling
let sql = format!(
"INSERT INTO {tp_table} (file_uuid, trace_id, name, start_frame, end_frame, \
frame_count, key_frame, key_face, status, avg_confidence, properties) \
frame_count, key_frame, key_face, status, avg_confidence, \
best_confidence, avg_capture_quality, best_capture_quality, avg_bbox, best_bbox, properties) \
SELECT $1, $2, $3, \
COALESCE((tn.properties->>'start_frame')::bigint, tp.start_frame), \
COALESCE((tn.properties->>'end_frame')::bigint, tp.end_frame), \
@@ -51,6 +52,11 @@ pub async fn upsert_trace_profile(
COALESCE(tn.properties->>'key_face', tp.key_face), \
'pending', \
COALESCE((tn.properties->>'avg_confidence')::double precision, tp.avg_confidence), \
COALESCE((tn.properties->>'best_confidence')::double precision, tp.best_confidence), \
COALESCE((tn.properties->>'avg_capture_quality')::double precision, tp.avg_capture_quality), \
COALESCE((tn.properties->>'best_capture_quality')::double precision, tp.best_capture_quality), \
COALESCE((tn.properties->>'avg_bbox')::jsonb, tp.avg_bbox), \
COALESCE((tn.properties->>'best_bbox')::jsonb, tp.best_bbox), \
COALESCE($4::jsonb, tn.properties, '{{}}'::jsonb) \
FROM (VALUES (1)) AS dummy \
LEFT JOIN {tkg_table} tn ON tn.file_uuid = $1 \
@@ -64,6 +70,11 @@ pub async fn upsert_trace_profile(
key_frame = COALESCE(EXCLUDED.key_frame, {tp_table}.key_frame), \
key_face = COALESCE(EXCLUDED.key_face, {tp_table}.key_face), \
avg_confidence = COALESCE(EXCLUDED.avg_confidence, {tp_table}.avg_confidence), \
best_confidence = COALESCE(EXCLUDED.best_confidence, {tp_table}.best_confidence), \
avg_capture_quality = COALESCE(EXCLUDED.avg_capture_quality, {tp_table}.avg_capture_quality), \
best_capture_quality = COALESCE(EXCLUDED.best_capture_quality, {tp_table}.best_capture_quality), \
avg_bbox = COALESCE(EXCLUDED.avg_bbox, {tp_table}.avg_bbox), \
best_bbox = COALESCE(EXCLUDED.best_bbox, {tp_table}.best_bbox), \
updated_at = NOW()",
);