From 83358a951dd8d278bbd19c79191d3ae1dea2b72b Mon Sep 17 00:00:00 2001 From: Accusys Date: Mon, 28 Sep 2026 02:06:43 +0800 Subject: [PATCH] feat: add config support for face_trace, face_deduplicate, scene_vlm_summary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增處理器配置: - face_trace: python (優先), rust (待實現) - face_deduplicate: python (優先), rust (待實現) - scene_vlm_summary: python (支持 LLM 參數) 工具優先級: face_trace: 1. python (priority=0, enabled=true) 2. rust (priority=1, enabled=false) face_deduplicate: 1. python (priority=0, enabled=true) 2. rust (priority=1, enabled=false) scene_vlm_summary: 1. python (priority=0, enabled=true) - model: gemma-4-12b-it - max_tokens: 300 ToolSelector 支持: - face_trace: face_trace.py, rust_face_trace - face_deduplicate: face_deduplicate.py, rust_face_deduplicate - scene_vlm_summary: scene_vlm_summary.py 目的: - 統一所有處理器配置架構 - 支持未來 Rust 實現 --- config/processor_tools.json | 51 +++++++++++++++++++++++++++++ src/core/processor/tool_selector.rs | 26 +++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/config/processor_tools.json b/config/processor_tools.json index 94a2f16b..45deb546 100644 --- a/config/processor_tools.json +++ b/config/processor_tools.json @@ -116,6 +116,57 @@ ], "default_tool": "swift", "enabled": true + }, + "face_trace": { + "tools": [ + { + "name": "python", + "priority": 0, + "enabled": true, + "parameters": {} + }, + { + "name": "rust", + "priority": 1, + "enabled": false, + "parameters": {} + } + ], + "default_tool": "python", + "enabled": true + }, + "face_deduplicate": { + "tools": [ + { + "name": "python", + "priority": 0, + "enabled": true, + "parameters": {} + }, + { + "name": "rust", + "priority": 1, + "enabled": false, + "parameters": {} + } + ], + "default_tool": "python", + "enabled": true + }, + "scene_vlm_summary": { + "tools": [ + { + "name": "python", + "priority": 0, + "enabled": true, + "parameters": { + "model": "gemma-4-12b-it", + "max_tokens": 300 + } + } + ], + "default_tool": "python", + "enabled": true } } } diff --git a/src/core/processor/tool_selector.rs b/src/core/processor/tool_selector.rs index 7e66cba3..50777d14 100644 --- a/src/core/processor/tool_selector.rs +++ b/src/core/processor/tool_selector.rs @@ -136,6 +136,32 @@ impl ToolSelector { if script.exists() { Some(script) } else { None } } + // Face trace tools + ("face_trace", "python") => { + let script = executor.script_path("face_trace.py"); + if script.exists() { Some(script) } else { None } + } + ("face_trace", "rust") => { + // Future: Rust face trace implementation + executor.rust_binary_path("rust_face_trace") + } + + // Face deduplicate tools + ("face_deduplicate", "python") => { + let script = executor.script_path("face_deduplicate.py"); + if script.exists() { Some(script) } else { None } + } + ("face_deduplicate", "rust") => { + // Future: Rust face deduplicate implementation + executor.rust_binary_path("rust_face_deduplicate") + } + + // Scene VLM summary tools + ("scene_vlm_summary", "python") => { + let script = executor.script_path("scene_vlm_summary.py"); + if script.exists() { Some(script) } else { None } + } + _ => None, } }