fix: ASRX duplication, TKG edges, trace ingest, and add pipeline progress publishing
- ASRX handler no longer stores duplicate 'asr' pre_chunks - Pre_chunks storage made idempotent (delete-before-insert) - Rule 1 + trace_ingest changed to query 'asrx' not 'asr' - Trace chunks removed (dynamic from TKG/Qdrant) - TKG scroll_face_points fixed: trace_id >= 1 (not == 1) - TKG AsrxSegmentEntry: start/end -> start_time/end_time (match ASRX JSON) - Unregister error handling: log instead of silent discard - Add publish_pipeline_progress calls at each pipeline stage (processors, rule1, face_trace, identity_agent, TKG, rule2, completion)
This commit is contained in:
@@ -1056,7 +1056,7 @@ async fn main() -> Result<()> {
|
||||
.filter_map(|name| {
|
||||
let name_lower = name.to_lowercase();
|
||||
match name_lower.as_str() {
|
||||
"appearance" => Some(ProcessorType::Appearance),
|
||||
"appearance" => Some(ProcessorType::Appearance),
|
||||
"asr" => Some(ProcessorType::Asr),
|
||||
"cut" => Some(ProcessorType::Cut),
|
||||
"asrx" => Some(ProcessorType::Asrx),
|
||||
@@ -1066,9 +1066,9 @@ async fn main() -> Result<()> {
|
||||
"pose" => Some(ProcessorType::Pose),
|
||||
"hand" => Some(ProcessorType::Hand),
|
||||
_ => {
|
||||
eprintln!("Unknown module: {}", name);
|
||||
None
|
||||
}
|
||||
eprintln!("Unknown module: {}", name);
|
||||
None
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
@@ -1082,7 +1082,7 @@ None
|
||||
.filter_map(|name| {
|
||||
let name_lower = name.to_lowercase();
|
||||
match name_lower.as_str() {
|
||||
"appearance" => Some(ProcessorType::Appearance),
|
||||
"appearance" => Some(ProcessorType::Appearance),
|
||||
"asr" => Some(ProcessorType::Asr),
|
||||
"cut" => Some(ProcessorType::Cut),
|
||||
"asrx" => Some(ProcessorType::Asrx),
|
||||
@@ -1092,9 +1092,9 @@ None
|
||||
"pose" => Some(ProcessorType::Pose),
|
||||
"hand" => Some(ProcessorType::Hand),
|
||||
_ => {
|
||||
eprintln!("Unknown cloud module: {}", name);
|
||||
None
|
||||
}
|
||||
eprintln!("Unknown cloud module: {}", name);
|
||||
None
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
@@ -1783,9 +1783,9 @@ None
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Store pre_chunks and frames to database
|
||||
// TODO: Store pre_chunks and frames to database
|
||||
|
||||
// Stop Redis subscriber
|
||||
redis_handle.abort();
|
||||
@@ -1822,10 +1822,10 @@ None
|
||||
if should_process(ProcessorType::Appearance) {
|
||||
let path = output_dir.get_output_path(&uuid, "appearance.json");
|
||||
println!(" - Appearance JSON: {}", path.display());
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Commands::Chunk { uuid } => {
|
||||
println!("Chunking: {}", uuid);
|
||||
|
||||
@@ -1933,18 +1933,22 @@ Ok(())
|
||||
Err(e) => {
|
||||
println!("Warning: Failed to parse Face JSON: {}. Skipping Face.", e);
|
||||
momentry_core::core::processor::face::FaceResult {
|
||||
status: None,
|
||||
frame_count: 0,
|
||||
fps: 0.0,
|
||||
frames: vec![],
|
||||
total_faces: 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
Err(_) => {
|
||||
println!("Warning: Face file not found. Skipping Face.");
|
||||
momentry_core::core::processor::face::FaceResult {
|
||||
status: None,
|
||||
frame_count: 0,
|
||||
fps: 0.0,
|
||||
frames: vec![],
|
||||
total_faces: 0,
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1993,18 +1997,22 @@ Ok(())
|
||||
Err(e) => {
|
||||
println!("Warning: Failed to parse ASRX JSON: {}. Skipping ASRX.", e);
|
||||
momentry_core::core::processor::asrx::AsrxResult {
|
||||
status: None,
|
||||
language: None,
|
||||
segments: vec![],
|
||||
embeddings: None,
|
||||
segment_count: 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
Err(_) => {
|
||||
println!("Warning: ASRX file not found. Skipping ASRX.");
|
||||
momentry_core::core::processor::asrx::AsrxResult {
|
||||
status: None,
|
||||
language: None,
|
||||
segments: vec![],
|
||||
embeddings: None,
|
||||
segment_count: 0,
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -2017,8 +2025,10 @@ Ok(())
|
||||
let deleted_frames = db.delete_frames_by_uuid(&uuid).await?;
|
||||
let deleted_tkg_nodes = db.delete_tkg_nodes_by_uuid(&uuid).await?;
|
||||
let deleted_tkg_edges = db.delete_tkg_edges_by_uuid(&uuid).await?;
|
||||
println!(" Deleted: {} pre_chunks, {} frames, {} tkg_nodes, {} tkg_edges",
|
||||
deleted_pre_chunks, deleted_frames, deleted_tkg_nodes, deleted_tkg_edges);
|
||||
println!(
|
||||
" Deleted: {} pre_chunks, {} frames, {} tkg_nodes, {} tkg_edges",
|
||||
deleted_pre_chunks, deleted_frames, deleted_tkg_nodes, deleted_tkg_edges
|
||||
);
|
||||
|
||||
println!("\nStoring pre_chunks...");
|
||||
|
||||
@@ -2324,10 +2334,13 @@ Ok(())
|
||||
|
||||
// Build TKG
|
||||
println!("\nBuilding TKG...");
|
||||
let tkg_result = momentry_core::core::processor::tkg::build_tkg(&db, &uuid, &output_dir).await?;
|
||||
println!("✓ TKG built: {} nodes, {} edges",
|
||||
let tkg_result =
|
||||
momentry_core::core::processor::tkg::build_tkg(&db, &uuid, &output_dir, None).await?;
|
||||
println!(
|
||||
"✓ TKG built: {} nodes, {} edges",
|
||||
tkg_result.face_track_nodes + tkg_result.hand_nodes + tkg_result.object_nodes,
|
||||
tkg_result.co_occurrence_edges + tkg_result.hand_object_edges);
|
||||
tkg_result.co_occurrence_edges + tkg_result.hand_object_edges
|
||||
);
|
||||
|
||||
println!("\n✓ Chunk stage completed!");
|
||||
println!(
|
||||
|
||||
Reference in New Issue
Block a user