From 8101ff0cb4d1f5d23e50a5fbf684cede3c1ff674 Mon Sep 17 00:00:00 2001 From: Accusys Date: Wed, 18 Nov 2026 01:05:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20face=20processor=20=E8=AE=80=E5=8F=96=20?= =?UTF-8?q?.with=5Fembedding=20=E6=AA=94=E6=A1=88=E7=95=B6=20copy=20?= =?UTF-8?q?=E5=A4=B1=E6=95=97=E6=99=82=EF=BC=88=E7=A2=BA=E4=BF=9D=20facene?= =?UTF-8?q?t=20embeddings=20=E4=B8=8D=E6=9C=83=E9=81=BA=E5=A4=B1=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/processor/face.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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")?;