diff --git a/src/core/processor/face.rs b/src/core/processor/face.rs index 323d34e6..f240fc00 100644 --- a/src/core/processor/face.rs +++ b/src/core/processor/face.rs @@ -600,15 +600,20 @@ pub async fn store_face_embeddings_to_qdrant( let frame_num = frame.frame; let timestamp_secs = frame_num as f64 / fps; - for face in &frame.faces { + for (idx, face) in frame.faces.iter().enumerate() { if let Some(embedding) = &face.embedding { let point_id = Uuid::new_v4().as_u128() as u64; + // Generate face_id if not present (format: face_{frame}_{idx}) + let face_id = face.face_id.as_deref() + .map(|s| s.to_string()) + .unwrap_or_else(|| format!("face_{}_{}", frame_num, idx)); + let payload = serde_json::json!({ "file_uuid": file_uuid, "frame": frame_num, "timestamp_secs": timestamp_secs, - "face_id": face.face_id.as_deref().unwrap_or(""), + "face_id": face_id, "confidence": face.confidence, "x": face.x, "y": face.y,