2cfcfdd1af
Phase 2.6.1: co_occurrence_edges migration - build_co_occurrence_edges_from_qdrant() - Qdrant embeddings → frame grouping → YOLO objects - Result: 6679 edges (vs 6701 PostgreSQL) Phase 2.6.2: face_face_edges migration - build_face_face_edges_from_qdrant() - Qdrant embeddings → frame grouping → face pairs - mutual_gaze detection preserved - Result: 6 edges (exact match) Phase 2.6.3: speaker_face_edges migration - build_speaker_face_edges_from_qdrant() - Qdrant embeddings → trace_id frame ranges - SPEAKS_AS edge creation Architecture: - All edges use Qdrant payload (no face_detections queries) - PostgreSQL fallback for empty Qdrant - Estimated 3.6x performance improvement Testing: - Playground (3003): ✓ All Phase 2.6 logs verified - Edge counts: ✓ Close match with PostgreSQL - Fallback: ✓ Working Docs: - docs_v1.0/DESIGN/TKG_PHASE2_6_EDGES_MIGRATION.md - docs_v1.0/M4_workspace/2026-06-21_phase2_6_test.md
52 lines
1.3 KiB
Rust
52 lines
1.3 KiB
Rust
//! Pose estimation processing module
|
|
|
|
use anyhow::Result;
|
|
use momentry_core::ui::progress::{ProcessorType, ProgressState, ProgressUi};
|
|
use momentry_core::OutputDir;
|
|
use std::path::Path;
|
|
use std::sync::{Arc, Mutex};
|
|
|
|
/// Process Pose module
|
|
pub async fn process_pose_module(
|
|
pose_path: &Path,
|
|
video_path: &str,
|
|
uuid: &str,
|
|
progress_state: &Arc<Mutex<ProgressState>>,
|
|
ui: &Arc<Mutex<Option<ProgressUi>>>,
|
|
) -> Result<()> {
|
|
{
|
|
let mut state = progress_state.lock().unwrap();
|
|
state.get_processor(ProcessorType::Pose).start(1);
|
|
}
|
|
|
|
let pose_result = momentry_core::core::processor::process_pose(
|
|
video_path,
|
|
pose_path.to_str().unwrap(),
|
|
Some(uuid),
|
|
None,
|
|
)
|
|
.await?;
|
|
|
|
let pose_json = serde_json::to_string_pretty(&pose_result)?;
|
|
std::fs::write(pose_path, &pose_json)?;
|
|
|
|
let output_dir = OutputDir::new();
|
|
let _ = output_dir.backup_file(uuid, "pose.json");
|
|
|
|
println!(" ✓ Pose saved: {} frames", pose_result.frames.len());
|
|
|
|
{
|
|
let mut state = progress_state.lock().unwrap();
|
|
state
|
|
.get_processor(ProcessorType::Pose)
|
|
.complete(&format!("{} frames", pose_result.frames.len()));
|
|
state.stop();
|
|
}
|
|
|
|
if let Some(ref mut ui) = *ui.lock().unwrap() {
|
|
let _ = ui.render();
|
|
}
|
|
|
|
Ok(())
|
|
}
|