feat: face fix deployment + trace_* regeneration + executor stderr filter fix
- swift_face.swift: frame rounding (.rounded()), conf 0.75, min_size 64 - trace_* directories regenerated for KOBA (37 traces, start_frame 5307) - executor.rs: stderr filter now logs all non-empty stderr (was discarding) - VAD not skippable in ASRX (main_fixed.py Step 2 always runs) - Step 2.5 sentence boundary refinement added - Cluster agent async endpoints + similarity transparency - Keyword search: relationship text extraction, priority ordering - Face fix handoff doc for Studio team
This commit is contained in:
+48
-1
@@ -1244,7 +1244,11 @@ pub async fn get_face_groups_handler(
|
||||
name,
|
||||
trace_count: trace_ids.len() as i32,
|
||||
representative_trace: trace_ids.first().copied().unwrap_or(0),
|
||||
trace_ids: if include_trace_ids { Some(trace_ids) } else { None },
|
||||
trace_ids: if include_trace_ids {
|
||||
Some(trace_ids)
|
||||
} else {
|
||||
None
|
||||
},
|
||||
editable: true,
|
||||
})
|
||||
.collect();
|
||||
@@ -1279,6 +1283,13 @@ pub struct ClusterResultsFrame {
|
||||
pub faces: Vec<ClusterResultsFace>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Clone)]
|
||||
pub struct ClusterSimilarityInfo {
|
||||
pub min: f64,
|
||||
pub avg: f64,
|
||||
pub threshold: f64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct ClusterResultsGroup {
|
||||
pub group_id: i32,
|
||||
@@ -1287,6 +1298,7 @@ pub struct ClusterResultsGroup {
|
||||
pub trace_ids: Vec<i32>,
|
||||
pub trace_count: i32,
|
||||
pub representative_trace: i32,
|
||||
pub similarity: Option<ClusterSimilarityInfo>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
@@ -1345,6 +1357,38 @@ pub async fn get_cluster_results_handler(
|
||||
|
||||
// trace_id -> cluster_id mapping for frame faces
|
||||
let mut trace_to_cluster: HashMap<i32, i32> = HashMap::new();
|
||||
|
||||
// Load face_cluster.json for similarity data
|
||||
let cluster_similarity: HashMap<String, ClusterSimilarityInfo> = {
|
||||
let output_dir = crate::core::config::OUTPUT_DIR.as_str();
|
||||
let fc_path = format!("{}/{}.face_cluster.json", output_dir, file_uuid);
|
||||
let mut map = HashMap::new();
|
||||
if let Ok(content) = std::fs::read_to_string(&fc_path) {
|
||||
if let Ok(data) = serde_json::from_str::<serde_json::Value>(&content) {
|
||||
if let Some(clusters) = data.get("clusters").and_then(|c| c.as_array()) {
|
||||
for c in clusters {
|
||||
if let (Some(cid), Some(sim)) = (
|
||||
c.get("cluster_id").and_then(|v| v.as_str()),
|
||||
c.get("similarity"),
|
||||
) {
|
||||
if let (Some(min), Some(avg), Some(threshold)) = (
|
||||
sim.get("min").and_then(|v| v.as_f64()),
|
||||
sim.get("avg").and_then(|v| v.as_f64()),
|
||||
sim.get("threshold").and_then(|v| v.as_f64()),
|
||||
) {
|
||||
map.insert(
|
||||
cid.to_string(),
|
||||
ClusterSimilarityInfo { min, avg, threshold },
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
map
|
||||
};
|
||||
|
||||
let face_groups: Vec<ClusterResultsGroup> = filtered_groups
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
@@ -1353,6 +1397,8 @@ pub async fn get_cluster_results_handler(
|
||||
for tid in &trace_ids {
|
||||
trace_to_cluster.insert(*tid, group_id);
|
||||
}
|
||||
// Try to find similarity data for this cluster
|
||||
let similarity = cluster_similarity.get(&name).cloned();
|
||||
ClusterResultsGroup {
|
||||
group_id,
|
||||
cluster_id: group_id,
|
||||
@@ -1360,6 +1406,7 @@ pub async fn get_cluster_results_handler(
|
||||
trace_count: trace_ids.len() as i32,
|
||||
representative_trace: trace_ids.first().copied().unwrap_or(0),
|
||||
trace_ids,
|
||||
similarity,
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
Reference in New Issue
Block a user