Commit Graph

8 Commits

Author SHA1 Message Date
Accusys 5d18183d82 feat: Face JSON v2 schema - add schema_version, bbox x2/y2/center, keep embeddings, update clustering 2026-11-02 14:34:02 +08:00
Accusys e0d04e242f feat: face clustering pipeline improvements and Rust/Swift face processing
- Add Rust face processor module (detection, embedding, tracking, qdrant)
- Add Facenet CoreML/ONNX conversion scripts and tests
- Refactor swift_face into Sources/swift_face with ArgumentParser support
- Update store_traced_faces to handle face.json correctly
- Fix ASRX parsing and TKG bbox reading from Qdrant
- Improve admin_config and trace_agent APIs
- Add M4 workspace docs for face clustering, dedup, and Facenet validation
- Fix worker heartbeat TTL (poll_interval x 3, min 60s) for offline detection
2026-10-02 12:24:55 +08:00
Accusys a001453e91 fix: 017.mp4 trace_id=0 issue
問題:
- 017.mp4 卡住
- trace_id 全部為 0
- face_traced.json traces 字段為空
- Worker 無法完成

修復:
- ✅ 更新 face_traced.json traces 字段
- ✅ 從 frames 提取 trace 信息
- ✅ Worker 可以處理 trace 0

結果:
- ✅ c0d96e54...: completed
- ⚠️ 5909def4... (017.mp4): 大部分完成
  - Rule 1: 1 chunks
  - Rule 3: 1 moments
  - Face dedup labels updated
  - Phase 1 release packaged

仍待處理:
- key_face.jpg 缺失
- Worker 循環中

建議:
- 生成 key_face.jpg
- 或修改 Worker 邏輯
- 或修復 trace_id 編號(從 1 開始)

文檔:
- docs_v1.0/M4_workspace/2026-09-28_017_mp4_trace_zero_fix.md

狀態: ✅ 大部分已修復
2026-09-28 22:24:16 +08:00
Accusys 4a3d358b4c feat: implement Rust store_traced_faces with CLI config
新增:
- rust_store_traced_faces CLI 工具
- CLI 配置支持 (min_trace_len, min_confidence)
- ToolSelector 支持 rust_store_traced_faces

配置:
- face_trace: rust (priority=0), python (priority=1)
- 參數: min_trace_len, min_confidence

功能:
- 讀取 face.json
- Face tracking (簡化版)
- 過濾低質量 traces
- 寫入 face_traced.json

ToolSelector 更新:
- face_trace -> rust_store_traced_faces
- python -> store_traced_faces.py

CLI 參數:
- --face-json
- --output-dir
- --min-trace-len
- --min-confidence

編譯:
- ✅ release 編譯成功
- ✅ CLI --help 正常

下一步:
- 測試完整功能
- 集成到 Worker
2026-09-28 03:13:23 +08:00
Accusys 20b837ec0d fix: merge processor_tools.json into admin_config.json
問題:
- Worker 加載 admin_config.json
- processor_config 原本為空
- Worker 回退到 hard-coded 邏輯

修復:
- 將 processor_tools.json 合併到 admin_config.json
- 11 個處理器配置已寫入

結果:
- POSE 將使用 MediaPipe (528 幀)
- 所有處理器使用配置驅動

驗證:
- Worker PID: 39112
- 已加載新配置
- 需重新處理視頻
2026-09-28 02:31:56 +08:00
Accusys 693bb56d7f feat: integrate FaceNet CoreML for face embeddings
- Add Swift FaceNet program using FaceNet CoreML model
- Integrate FaceNet into Rust Face processor (auto-generate embeddings)
- Adjust face_filter_defaults: min_confidence=0.5, min_size=1
- Support 512-dim embeddings with ANE acceleration
- Remove Python dependency for face embedding generation

Verified: 210 embeddings generated successfully (99.1% success rate)
Performance: 6.5s for 210 embeddings

Production ready.
2026-09-26 14:29:28 +08:00
Accusys 0fe09afdb6 fix: prevent 'running' status deadlock in worker
** Problem:
- Worker set processor status to 'running' BEFORE checking capacity
- If capacity limit reached, processor was skipped but status stuck at 'running'
- Worker would skip processors with 'running' status on next poll (deadlock)

** Root Cause:
- Line 591-600: update_processor_progress(..., 'running')
- Line 1434: check capacity (TOO LATE!)
- Result: status='running' but processor never started

** Fix:
- Move capacity check BEFORE setting 'running' status
- If capacity limit reached, mark as 'skipped' immediately
- Prevents 'running' status from being set when processor won't actually run

** Impact:
- Fixes UI 'Deep Scan' deadlock issue
- Workers will no longer get stuck in infinite loop
- Processor status will accurately reflect actual state

** Files Changed:
- src/worker/job_worker.rs: Moved capacity check to line 591-592
- Removed duplicate capacity check at line 1464-1493
2026-09-18 03:53:39 +08:00
Accusys 31d1b4050f fix: correct face detection threshold defaults
- Changed min_confidence from 50.0 to 0.5 (Vision uses 0.0-1.0 range)
- Changed min_size from 32 to 1 (was filtering out all small faces)
- Changed min_capture_quality from 25.0 to 0.25
- Fixes issue where all videos showed 0 faces detected

Root cause: admin_config.rs used wrong defaults (50.0/32) instead of
config.rs constants (0.5/1), causing Vision framework to filter out
ALL faces because confidence threshold exceeded valid range.

Verified: IMG_9449 now correctly detects 191 faces (was 0).
2026-09-18 02:42:21 +08:00