diff --git a/src/core/processor/face.rs b/src/core/processor/face.rs index a94febbb..3a8f516f 100644 --- a/src/core/processor/face.rs +++ b/src/core/processor/face.rs @@ -576,11 +576,11 @@ async fn run_face_with_config( // Generate embeddings with FaceNet CoreML let facenet_path = swift_processor_path("facenet_embedding"); + let facenet_output = format!("{}.with_embedding", output_path); if facenet_path.exists() { tracing::info!("[FACE] Generating embeddings with FaceNet CoreML"); - let facenet_output = format!("{}.with_embedding", output_path); let mut facenet_args = vec![ video_path.to_string(), output_path.to_string(), @@ -614,7 +614,13 @@ async fn run_face_with_config( } } - let json_str = std::fs::read_to_string(output_path) + // Read face.json (prefer .with_embedding if copy failed) + let json_path = if std::path::Path::new(&facenet_output).exists() { + &facenet_output + } else { + output_path + }; + let json_str = std::fs::read_to_string(json_path) .context("Failed to read Swift FACE output")?; let mut result: FaceResult = serde_json::from_str(&json_str).context("Failed to parse Swift FACE output")?;