feat: integrate embeddings storage to Face processor

- Create store_face_embeddings_to_qdrant.py script
- Add automatic Qdrant storage call after FaceNet completes
- Store 512D embeddings with metadata (frame, confidence, bbox)
- Enables downstream face tracing and clustering

This ensures embeddings are automatically stored in Qdrant without manual intervention.
This commit is contained in:
Accusys
2026-09-26 21:32:56 +08:00
parent 55fcbf107d
commit b0244691cb
2 changed files with 165 additions and 0 deletions
+31
View File
@@ -199,6 +199,37 @@ pub async fn process_face(
}
}
// Store embeddings to Qdrant after FaceNet completes
if let Some(file_uuid) = uuid {
tracing::info!("[FACE] Storing embeddings to Qdrant for {}", file_uuid);
let store_script = std::path::Path::new("/Users/accusys/momentry_core/scripts/store_face_embeddings_to_qdrant.py");
if store_script.exists() {
let store_output = tokio::process::Command::new("python3")
.arg(store_script)
.arg("--file-uuid")
.arg(file_uuid)
.output()
.await;
match store_output {
Ok(output) if output.status.success() => {
tracing::info!("[FACE] Embeddings stored to Qdrant successfully");
}
Ok(output) => {
let stderr = String::from_utf8_lossy(&output.stderr);
tracing::warn!("[FACE] Embedding storage failed: {}", stderr);
}
Err(e) => {
tracing::warn!("[FACE] Embedding storage error: {}", e);
}
}
} else {
tracing::warn!("[FACE] store_face_embeddings_to_qdrant.py not found");
}
} else {
tracing::warn!("[FACE] No UUID provided, skipping Qdrant storage");
}
let json_str = std::fs::read_to_string(output_path).context("Failed to read FACE output")?;
let mut result: FaceResult = serde_json::from_str(&json_str).context("Failed to parse FACE output")?;
result.compute_status();