fix: face_detections INSERT in pipeline, add dependency graph doc
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user