fix: ASRX null frame tolerance and FaceCluster unblocking

- AsrxSegment.start_frame/end_frame -> Option<u64> so the ASR fallback
  (which emits null frames) deserializes instead of erroring
- P2 face-trace trigger gated on has_face alone (not has_asrx), so
  no-face videos still get face_traced.json via the fast-path,
  unblocking FaceCluster and preventing the job from failing
This commit is contained in:
Accusys
2026-10-02 13:50:49 +08:00
parent 193af91cd7
commit 9e1fa0a3ff
4 changed files with 13 additions and 11 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ pub async fn store_asrx_chunks(db: &PostgresDb, uuid: &str) -> Result<()> {
"end_frame": segment.end_frame,
});
pre_chunks.push((
segment.start_frame as i64,
segment.start_frame.unwrap_or(0) as i64,
Some(segment.start_time),
data,
None,
+8 -8
View File
@@ -51,9 +51,9 @@ pub struct AsrxSegment {
#[serde(alias = "end")]
pub end_time: f64,
#[serde(default)]
pub start_frame: u64,
pub start_frame: Option<u64>,
#[serde(default)]
pub end_frame: u64,
pub end_frame: Option<u64>,
pub text: String,
pub speaker_id: Option<String>,
#[serde(default)]
@@ -209,8 +209,8 @@ mod tests {
segments: vec![AsrxSegment {
start_time: 0.0,
end_time: 2.5,
start_frame: 0,
end_frame: 75,
start_frame: Some(0),
end_frame: Some(75),
text: "Hello".to_string(),
speaker_id: Some("SPEAKER_00".to_string()),
language: None,
@@ -262,8 +262,8 @@ mod tests {
let segment = AsrxSegment {
start_time: 0.0,
end_time: 5.0,
start_frame: 0,
end_frame: 150,
start_frame: Some(0),
end_frame: Some(150),
text: "Test".to_string(),
speaker_id: None,
language: None,
@@ -286,7 +286,7 @@ mod tests {
assert_eq!(result.segments[0].start_time, 10.0);
assert_eq!(result.segments[0].end_time, 12.5);
assert_eq!(result.segments[0].text, "Hello");
assert_eq!(result.segments[0].start_frame, 0);
assert_eq!(result.segments[0].end_frame, 0);
assert_eq!(result.segments[0].start_frame, None);
assert_eq!(result.segments[0].end_frame, None);
}
}
+3 -1
View File
@@ -2821,13 +2821,15 @@ impl JobWorker {
}
}
if has_face && has_asrx {
if has_face {
let mut pp = PipelineProgress::new(uuid);
pp.update_stage("processors", 1.0, "completed", None);
publish_pipeline_progress(self.redis.as_ref(), uuid, &pp).await;
// 🚀 P2 Trigger: Face Trace + DB Store (after Face)
// Runs face_tracker.py (IoU+embedding tracking), stores trace_id + position in DB
// Note: trigger is gated on face alone (not has_asrx) so no-face videos still
// get face_traced.json written via the fast-path, unblocking FaceCluster.
if has_face {
let traced_path = format!(
"{}/{}.face_traced.json",
+1 -1
View File
@@ -1521,7 +1521,7 @@ impl ProcessorPool {
});
pre_chunks_to_store.push((
segment.start_frame as i64,
segment.start_frame.unwrap_or(0) as i64,
Some(segment.start_time),
data,
None,