From 8c6a2de82086e5699feda3fc17803469baec3bd1 Mon Sep 17 00:00:00 2001 From: Accusys Date: Fri, 2 Oct 2026 14:25:44 +0800 Subject: [PATCH] fix: use positional args for swift face/pose config-driven execution The swift_face/swift_pose CLIs take positional paths, but processor_tools_v3.json passed an unsupported --output flag, so the config-driven path always failed (exit 64, 'Unknown option --output') and fell back to hard-coded logic for every face/pose run. - config/processor_tools_v3.json: drop --output, use positional args - face.rs/pose.rs: expand {video_path}/{output_path}/{file_uuid} placeholders in config args before executing Verified: positional args exit 0 and produce face.json; old args exit 64. --- config/processor_tools_v3.json | 2 -- src/core/processor/face.rs | 9 ++++++++- src/core/processor/pose.rs | 9 ++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/config/processor_tools_v3.json b/config/processor_tools_v3.json index 6b30b3eb..6ede33a3 100644 --- a/config/processor_tools_v3.json +++ b/config/processor_tools_v3.json @@ -31,7 +31,6 @@ "executable": "scripts/swift_processors/.build/release/swift_pose", "args": [ "{video_path}", - "--output", "{output_path}", "--uuid", "{file_uuid}" @@ -103,7 +102,6 @@ "executable": "scripts/swift_processors/.build/release/swift_face", "args": [ "{video_path}", - "--output", "{output_path}", "--uuid", "{file_uuid}" diff --git a/src/core/processor/face.rs b/src/core/processor/face.rs index f240fc00..0488a293 100644 --- a/src/core/processor/face.rs +++ b/src/core/processor/face.rs @@ -345,7 +345,14 @@ async fn run_face_with_config( let args = if !tool.args.is_empty() { tracing::info!("[FACE] Using args from config: {:?}", tool.args); - tool.args.clone() + tool.args + .iter() + .map(|a| { + a.replace("{video_path}", video_path) + .replace("{output_path}", output_path) + .replace("{file_uuid}", uuid.unwrap_or("")) + }) + .collect() } else { let mut args = vec![video_path.to_string(), output_path.to_string()]; if let Some(u) = uuid { diff --git a/src/core/processor/pose.rs b/src/core/processor/pose.rs index 6e46e22c..13f2f891 100644 --- a/src/core/processor/pose.rs +++ b/src/core/processor/pose.rs @@ -526,7 +526,14 @@ async fn run_pose_with_config( let args = if !tool.args.is_empty() { tracing::info!("[POSE] Using args from config: {:?}", tool.args); - tool.args.clone() + tool.args + .iter() + .map(|a| { + a.replace("{video_path}", video_path) + .replace("{output_path}", output_path) + .replace("{file_uuid}", uuid.unwrap_or("")) + }) + .collect() } else { let mut args = vec![video_path.to_string(), output_path.to_string()]; if let Some(u) = uuid {