fix: face processor 讀取 .with_embedding 檔案當 copy 失敗時(確保 facenet embeddings 不會遺失)
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled

This commit is contained in:
Accusys
2026-11-18 01:05:38 +08:00
parent 18aa0130a7
commit 8101ff0cb4
+8 -2
View File
@@ -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")?;