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
+22 -10
View File
@@ -1421,6 +1421,7 @@ pub async fn exec_trace_search(
let sql = format!(
"SELECT tp.file_uuid, tp.trace_id, tp.name, tp.start_frame, tp.end_frame, \
tp.frame_count, tp.key_frame, tp.status, tp.avg_confidence, \
tp.avg_capture_quality, tp.best_capture_quality, tp.best_confidence, \
tp.vlm_description, tp.vlm_clothing, tp.vlm_tags, tp.vlm_location, \
tp.vlm_setting, tp.vlm_lighting, COALESCE(v.file_name, ''), COALESCE(v.fps, 25.0) \
FROM {} tp \
@@ -1459,14 +1460,17 @@ pub async fn exec_trace_search(
let key_frame: Option<String> = row.get(6);
let status: Option<String> = row.get(7);
let avg_confidence: Option<f64> = row.get(8);
let vlm_description: Option<String> = row.get(9);
let vlm_clothing: Option<String> = row.get(10);
let vlm_tags: Option<Vec<String>> = row.get(11);
let vlm_location: Option<String> = row.get(12);
let vlm_setting: Option<String> = row.get(13);
let vlm_lighting: Option<String> = row.get(14);
let file_name: String = row.get(15);
let fps: f64 = row.get(16);
let avg_capture_quality: Option<f64> = row.get(9);
let best_capture_quality: Option<f64> = row.get(10);
let best_confidence: Option<f64> = row.get(11);
let vlm_description: Option<String> = row.get(12);
let vlm_clothing: Option<String> = row.get(13);
let vlm_tags: Option<Vec<String>> = row.get(14);
let vlm_location: Option<String> = row.get(15);
let vlm_setting: Option<String> = row.get(16);
let vlm_lighting: Option<String> = row.get(17);
let file_name: String = row.get(18);
let fps: f64 = row.get(19);
let start_time = start_frame.map(|f| (f as f64 / fps).round() / 100.0);
let end_time = end_frame.map(|f| (f as f64 / fps).round() / 100.0);
@@ -1485,6 +1489,9 @@ pub async fn exec_trace_search(
"key_frame": key_frame,
"status": status,
"avg_confidence": avg_confidence,
"best_confidence": best_confidence,
"avg_capture_quality": avg_capture_quality,
"best_capture_quality": best_capture_quality,
"vlm_description": vlm_description,
"vlm_clothing": vlm_clothing,
"vlm_tags": vlm_tags,
@@ -1652,6 +1659,7 @@ pub async fn exec_face_profile_search(
"SELECT tp.file_uuid, tp.trace_id, tp.name, \
tp.start_frame, tp.end_frame, tp.frame_count, \
tp.key_frame, tp.key_face, tp.avg_confidence, \
tp.avg_capture_quality, tp.best_capture_quality, \
n.external_id \
FROM {} tp \
LEFT JOIN {} n ON n.file_uuid = tp.file_uuid \
@@ -1691,7 +1699,9 @@ pub async fn exec_face_profile_search(
let key_frame: Option<String> = row.get(6);
let key_face: Option<String> = row.get(7);
let avg_confidence: Option<f64> = row.get(8);
let external_id: Option<String> = row.get(9);
let avg_capture_quality: Option<f64> = row.get(9);
let best_capture_quality: Option<f64> = row.get(10);
let external_id: Option<String> = row.get(11);
serde_json::json!({
"card_type": "face_profile",
@@ -1704,7 +1714,9 @@ pub async fn exec_face_profile_search(
"frame_count": frame_count,
"key_frame": key_frame,
"key_face": key_face,
"avg_confidence": avg_confidence
"avg_confidence": avg_confidence,
"avg_capture_quality": avg_capture_quality,
"best_capture_quality": best_capture_quality
})
})
.collect();