fix: face_detections INSERT in pipeline, add dependency graph doc

This commit is contained in:
Accusys
2026-05-17 22:16:20 +08:00
parent d6c8930f84
commit a880c80556
4 changed files with 149 additions and 24 deletions

View File

@@ -887,12 +887,14 @@ impl ProcessorPool {
) -> Result<()> {
let frames_count = face_result.frames.len();
tracing::info!(
"Storing {} Face pre-chunks for video {}",
"Storing {} Face pre-chunks + {} detections for video {}",
frames_count,
face_result.frames.iter().map(|f| f.faces.len()).sum::<usize>(),
uuid
);
let mut pre_chunks_to_store = Vec::new();
let mut detections_to_store = Vec::new();
for frame in face_result.frames.iter() {
let data = serde_json::json!({
@@ -901,10 +903,21 @@ impl ProcessorPool {
});
pre_chunks_to_store.push((frame.frame as i64, Some(frame.timestamp), data, None, None));
for face in frame.faces.iter() {
detections_to_store.push((
frame.frame as i64,
frame.timestamp,
face.x, face.y, face.width, face.height,
face.confidence,
));
}
}
db.store_raw_pre_chunks_batch(uuid, "face", &pre_chunks_to_store)
.await?;
db.store_face_detections_batch(uuid, &detections_to_store)
.await?;
Ok(())
}