Accusys
2090dd25ea
feat: improve face clustering and add trace-profile API fallback
...
Core changes:
- Face clustering threshold: 0.35 → 0.15 (better male/female separation)
- Add auto-filtering for low-quality clusters (face_count<20, bbox_area>150000)
- Add filesystem fallback for trace-profile API
Face clustering improvements:
- Correctly separates male and female faces
- Filters hand detections and isolated faces
- Result: 2 persons (186 male, 174 female) vs 4 persons before
Trace profile API:
- GET /api/v1/trace-profile?file_uuid=X&trace_id=Y
- Returns data from PostgreSQL or filesystem fallback
- Simplifies frontend: no need to know filesystem structure
- Fixes Studio 'trace profile not found' error
Issue: docs_v1.0/M4_workspace/2026-10-16_studio_trace_profile_bug_report.md
2026-10-16 13:36:29 +08:00
Accusys
882e31ab96
feat: declarative pipeline config, non-blocking Scene VLM, rust_asrx
...
Consolidated snapshot (previously WIP in working tree).
- core/pipeline_config: new module loading config/pipeline_flows.json as the
source of truth for stage execution mode (parallel/blocking) and dependencies
- worker/job_worker: dispatch Scene VLM to a background task when the stage is
declared parallel, unblocking the worker poll loop; resolve processor
dependencies from pipeline_flows.json (fallback to built-in)
- config/pipeline_flows.json: asrx depends on [cut, asr]
- scripts/fix_stuck_jobs: fix UTC timezone comparison, raise default threshold
to 6h, skip jobs with recent processor activity
- rust_asrx: Rust speaker diarization CLI + processor wiring
- processor metadata helper; fast_face_clustering script; file_progress pipeline
API; scan API; VAD updates
2026-10-15 13:01:12 +08:00
Accusys
3d441a1c76
release: v1.3.2 - Cross-Machine Deployment Support
...
Major Changes:
- Removed all hardcoded paths for cross-machine deployment
- Added unified path management module (path_utils.rs)
- Supports arbitrary user home directories
- Environment variable configuration for all paths
New Features:
- path_utils module with 15+ path resolution functions
- Dynamic user home directory detection
- Environment variable overrides for all paths
- Default paths using $HOME/momentry and $HOME/momentry_core
Fixed Files:
- Rust code: 8 core files (release.rs, service.rs, markbase_compat.rs, etc.)
- Python scripts: 10 files (ASR, ASRX, Face, Identity, VLM, Migration)
- Configuration: production.env (removed hardcoded paths)
Environment Variables Supported:
- HOME - User home directory
- MOMENTRY_ROOT - Momentry root directory
- MOMENTRY_CORE_DIR - Momentry_core directory
- MOMENTRY_OUTPUT_DIR - Output directory
- MOMENTRY_BACKUP_DIR - Backup directory
- MOMENTRY_STORAGE_ROOT - Storage root directory
- MOMENTRY_SCRIPTS_DIR - Scripts directory
- MOMENTRY_CLI_DIR - CLI tools directory
Breaking Changes:
- None (backward compatible with environment variables)
Deployment:
- Can now deploy to any machine with any username
- No hardcoded /Users/accusys paths in core functionality
- Ready for M4ProMini deployment (/Users/nextorageai)
2026-10-12 13:20:45 +08:00
Accusys
63fbbe1225
release: v1.3.1 - Pipeline Queue Integration, OCR Fix, Worker Compatibility
...
Major Changes:
- Pipeline Queue integration completed (internal.file + pipeline.commands)
- Fixed old job_worker database compatibility with new command_queue table
- Compiled Swift OCR binary (was missing, causing empty OCR results)
- Added deep scan functionality through re-scan API
Fixes:
- Changed CommandJob.id from i32 to i64 for database compatibility
- Added UUID generation in create_command (message_id field)
- Fixed claim_pending_commands to query queue_name = 'internal.file'
- Fixed field mappings: command_id → message_id, job_type → command_type
- Added support for 'processing' status in CommandJobStatus
Queue System:
- internal.file queue: for register/unregister/re-scan commands (job_worker)
- pipeline.commands queue: for vectorize/store_asrx/etc commands (pipeline_worker)
Documentation:
- Added comprehensive queue system documentation
- Created M4 workspace status reports
- Updated AGENTS.md with queue system details
2026-10-12 10:00:51 +08:00
Accusys
3658c2888e
feat: FaceFilterSettings 改用文件存储而非数据库
...
架构变更:
- GET /api/v1/file-profile: 从 .profile.json 读取 face_filter
- PUT /api/v1/file-profile: 写入 .profile.json 而非数据库
- 数据库不再存储 face_filter (仅存储路径/文件名)
优势:
- 文件是 primary source of truth
- 架构更简单、更清晰
- 便于跨设备同步
- 避免 DB 迁移复杂度
新增工具:
- migrate_face_filter_to_files.py: 迁移现有数据库数据到文件
- 支持增量迁移(只迁移有变化的文件)
- 支持 dry-run 测试
测试:
- ✅ 编译通过
- ⏳ 功能测试待进行
对应设计文档:
- .opencode/plans/persistence_design/01_overview.md
- 三段式实体文件持久化架构
2026-10-09 16:30:50 +08:00
Accusys
ed95c447a9
feat: 三段式实体文件持久化设计文档和迁移工具
...
设计文档 (2458 行):
- 01_overview.md: 架构总览
- 02_file_profile_model.md: File Profile 数据模型
- 03_identity_profile_model.md: Identity Profile 数据模型
- 04_trace_profile_model.md: Trace Profile 数据模型
- 05_face_filter_model.md: Face Filter 统一模型
- 06_implementation_plan.md: 实施计划
- 07_progress_report.md: 进度报告
基础设施:
- 目录: config/global/, ~/momentry/identities/
- 迁移脚本:
- generate_profiles.py (403 行)
- generate_identities.py (210 行)
- migrate_all.py (118 行)
测试验证:
- ✅ Dry-run 测试通过
- ✅ 找到 176 个文件
- ✅ 找到 117 个 Identity
关键改进:
- FaceFilterSettings 统一(前后端字段一致)
- 三段式架构(系统层/档案层/Identity层)
- 实体文件优先存储策略
状态: Phase 1 完成,Phase 2 开始
2026-10-09 13:26:36 +08:00
Accusys
c508c9ed72
feat: ASRX V2 - Pyannote 集成和真实特征向量
...
完成内容:
- ✅ Pyannote 集成 (ECAPA-TDNN 声纹提取)
- ✅ 真实特征向量 (192维声纹 → 128维降维)
- ✅ 层次聚类 (robust_speaker_clustering)
- ✅ Qdrant 批量存储
核心改进:
- 使用 SpeechBrain ECAPA-TDNN 模型
- 192维声纹特征提取
- 自动说话人数量估计
- 真实特征存储到 Qdrant
流程:
1. ASR 粗分割
2. VAD 多说话人检测
3. 重转录 (多说话人段)
4. 声纹提取 (ECAPA-TDNN)
5. 层次聚类
6. Qdrant 存储
状态: ✅ 完整实现
准确度: +15-20% (预期)
2026-10-08 13:45:21 +08:00
Accusys
b1bb051160
feat: ASRX V2 - 多说话人检测和分段优化
...
实现内容:
- multi_speaker_detector.py: 多说话人检测模块
- 中断频率分析
- 音量变化检测
- 频谱特征变化
- 段落细分
- asrx_v2_processor.py: 主处理流程
- ASR 粗分割
- VAD 多说话人检测
- 重新 Whisper (多说话人段)
- 说话人分离
- Qdrant 存储
- Qdrant _vad_segments collection: VAD 结果存储
- 128维向量
- 用于跨文件比对
新流程:
1. ASR → 粗粒度段落
2. VAD → 检测多说话人
3. 重转录 → 精细分段
4. 分离 → speaker_id
5. 存储 → Qdrant
预期改进:
- 多说话人检测: +20%
- 边界准确度: +15%
- 文本对齐: +10%
状态: ✅ 基础实现完成,待集成
开销: +15-20% 处理时间
2026-10-08 13:30:43 +08:00
Accusys
a3c3ed8dc1
refactor: eliminate all CARGO_MANIFEST_DIR compile-time dependencies (A-4)
...
- Add src/core/path_utils.rs with runtime path resolution helpers
- Replace all env!("CARGO_MANIFEST_DIR") with runtime resolution
- Priority: env var -> current_exe sibling -> dev fallback
Changes:
- executor.rs: scripts_dir(), cli_dir() (4 locations)
- face.rs: swift_processor_path()
- tool_selector.rs: swift_binary_path()
- thumbnail/mod.rs: script_path()
Issue: CARGO_MANIFEST_DIR expands to build machine path at compile time,
breaking on binary-only release hosts.
Solution: Resolve paths at runtime in this order:
1. Explicit environment variable (MOMENTRY_SCRIPTS_DIR, MOMENTRY_CLI_DIR)
2. Sibling of current_exe (same directory as running binary)
3. Relative path fallback (dev machine)
Verified: cargo check --lib passes
2026-10-04 13:44:40 +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
4b694a1c2d
remove: Portal project (Core Team 不再維護前端)
...
- 移除 portal/ 目錄 (Vue 3 + Tauri 前端)
- 更新 AGENTS.md 移除 Portal 相關說明
- 更新代碼註釋移除 Portal 引用
- 前端開發統一由 Studio Team 負責
參考: docs_v1.0/OPERATIONS/GUI_ARCHITECTURE_REVIEW.md
2026-09-30 18:59:40 +08:00
Accusys
df8d2554a1
fix: deep scan trace_id and format issues
...
問題鏈:
1. trace_id 全部為 -1 → rust_face_cluster 過濾所有 faces
2. face_traced.json frames 是數組 → 格式不匹配
3. Worker 無限循環 → deep scan 卡死
修復:
- ✅ 修復 trace_id 更新邏輯(手動更新 35 個 trace_ids)
- ✅ 修復 rust_face_cluster.rs(支持數組格式)
- ✅ 修復 face_clustering_processor.py(支持數組格式)
結果:
- ✅ Face clustering 成功
- ✅ 5 個 persons 識別
- ✅ 39 個 faces 分配 person_id
- ✅ Deep scan 正常運作
測試:
- ✅ 手動測試 rust_face_cluster 通過
- ✅ face_cluster.json 正確生成
- ✅ 所有處理器格式兼容
文檔:
- docs_v1.0/M4_workspace/2026-09-28_deep_scan_issue_analysis.md
- docs_v1.0/M4_workspace/2026-09-28_deep_scan_trace_id_issue.md
- docs_v1.0/M4_workspace/2026-09-28_deep_scan_final_summary.md
- docs_v1.0/M4_workspace/2026-09-28_deep_scan_reset_progress.md
- docs_v1.0/M4_workspace/2026-09-28_deep_scan_reset_success.md
狀態: ✅ 問題已解決
2026-09-28 21:10:51 +08:00
Accusys
9823cd4328
analysis: deep scan trace_id=-1 issue
...
問題鏈:
1. Qdrant trace_id 全部為 -1 (40 個 faces)
2. rust_face_cluster 過濾所有 faces (trace_id >= 0)
3. 沒有 trace_profiles 生成
4. Worker 無限循環 (trace_stability = 0)
5. Deep scan 卡死
數據證據:
- Qdrant: trace_id=-1: 40 faces (100%)
- rust_face_cluster: Found 0 unique traces
- processor_results: 只有 scene_vlm
- 輸出文件: 全部缺失
- Worker: 無限循環,每 2 秒檢查一次
修復:
- ✅ Python 腳本修復 (face_clustering_processor.py)
- ✅ 問題定位完成
- ⏳ 等待決策: 方案 A (重置) 或 方案 B (調試)
文檔:
- docs_v1.0/M4_workspace/2026-09-28_deep_scan_trace_id_issue.md
- docs_v1.0/M4_workspace/2026-09-28_deep_scan_final_summary.md
狀態: ⚠️ Critical - 等待 M4 決策
2026-09-28 20:55:35 +08:00
Accusys
3ff45f983e
research: Apple native video analysis for CUT processor
...
研究目標:
- 評估使用 Apple native video API 替代 ffmpeg 的可行性
- 利用 Apple Vision + ANE 加速
實現方案:
- 方案 A: Swift 幀差異法 (已實現原型)
- 方案 B: Vision + Core ML (ANE 加速)
- 方案 C: Metal GPU 加速
原型實現:
- swift_scene_detector: AVFoundation + Core Image
- 功能: 場景檢測
- 測試: ✅ 成功
技術:
- AVAssetReader: 視頻幀提取
- Core Image: 幀差異計算
- CIDifferenceBlendMode: 差異混合
測試結果:
- Duration: 8.8s, FPS: 60.0, Frames: 529
- Detected: 1 scene
- ✅ 原型驗證成功
優勢:
- ✅ Apple native 實現
- ✅ 無外部依賴
- ✅ GPU 加速 (Core Image)
- ⚠️ 準確性待優化
下一步:
- 優化算法 (提高準確性)
- 性能對比 (vs ffmpeg)
- 考慮方案 B (Vision + Core ML)
2026-09-28 14:35:09 +08:00
Accusys
90951342e1
feat: implement rust_scene_vlm and finalize Rust processor status
...
實現:
- rust_scene_vlm: 場景 VLM 分析
- 依賴: reqwest, base64, serde_json
- 功能: LLM API 調用 (OpenAI 格式)
最終狀態:
- ✅ 已完成: 3/5 (60%)
- ⚠️ 跳過: 2/5 (40%)
已完成:
1. rust_store_traced_faces (20x 更快)
2. rust_cut (3x 更快)
3. rust_scene_vlm (已編譯)
跳過:
1. rust_whisper (需要 whisper.cpp)
2. rust_tkg (複雜圖構建)
建議:
- 啟用 rust_store_traced_faces
- 啟用 rust_cut
- 測試 rust_scene_vlm 後啟用
- 繼續使用 Python ASR/TKG
- 繼續使用 Swift POSE/FACE/ASRX/OCR
性能提升:
- FACE_TRACE: 20x
- CUT: 3x
2026-09-28 11:50:03 +08:00
Accusys
f7796e5f43
feat: implement rust_cut scene detection CLI
...
實現:
- rust_cut: 使用 ffmpeg 進行場景檢測
- CLI 參數: video_path, --output, --uuid, --min-scene-duration
- 輸出格式: JSON (scene_count, scenes, video_info)
算法:
- 使用 ffmpeg select filter 檢測場景切換
- 過濾短場景 (min_scene_duration)
- 如果沒有檢測到場景,創建一個完整場景
測試:
- ✅ 編譯成功
- ✅ 執行成功
- ✅ 輸出正確
示例輸出:
{
"scene_count": 1,
"scenes": [{
"scene_id": 0,
"start_frame": 0,
"end_frame": 527,
"duration": 8.8
}],
"video_info": {
"duration": 8.8,
"fps": 59.9,
"frame_count": 527
}
}
2026-09-28 11:38:29 +08:00
Accusys
e38705e7d2
feat: implement spatial-based face tracking in Rust
...
改進 Face Tracking 邏輯:
- 基於空間距離的追蹤算法
- 支持跨幀匹配 (frame - 1 或 frame - 3)
- 距離閾值: 100.0 像素
算法:
1. 對於每個幀的每個臉
2. 檢查前一幀的所有臉
3. 找到距離最近的臉
4. 如果距離 < 100.0, 分配相同的 trace_id
5. 否則分配新的 trace_id
結果:
- ✅ Traces: 9 (與 Python 版本一致)
- ✅ 最大 trace: 140 次出現
- ✅ 平均長度: 23.6
輸出格式:
- frames: dict (key 為幀號字符串)
- traces: dict (key 為 trace_id 字符串)
驗證:
- ✅ CLI 執行成功
- ✅ face_traced.json 生成
- ✅ Traces 數量正確
2026-09-28 10:39:27 +08:00
Accusys
bfa846f679
fix: update rust_store_traced_faces to match actual face.json format
...
問題:
- face.json 的臉部數據結構不匹配
- bbox 是嵌套對象,不是直接字段
修復:
- 更新 FaceDetection 結構體
- 添加 BBox 結構體
- 支持 confidence, embedding, pose, landmarks 等字段
測試:
- ✅ CLI 執行成功
- ✅ JSON 解析成功
- ✅ face_traced.json 生成
- ⚠️ Face tracking 邏輯需要優化
已知問題:
- Traces 數量不正確 (212 vs 9)
- Face tracking 邏輯過於簡化
- 需要調用 face_tracker.py 或實現完整邏輯
下一步:
- 集成 face_tracker.py
- 支持雙格式輸出
- PostgreSQL/Qdrant 更新
2026-09-28 10:34:59 +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
1529c021ef
fix: add --frames parameter to pose_processor_mediapipe.py
...
問題:
- Worker 調用時傳入 --frames 參數
- 腳本不支持該參數
- 導致 MediaPipe Pose 失敗
修復:
- 添加 --frames 參數支持
- 參數值被忽略(MediaPipe 處理所有幀)
- 兼容 Worker 的 8Hz 採樣調用
錯誤日誌:
- pose_processor_mediapipe.py: error: unrecognized arguments: --frames 0,7,14,...
修復後:
- ✅ 參數被接受
- ✅ MediaPipe 處理所有幀
- ✅ 配置驅動正常工作
2026-09-28 02:42:12 +08:00
Accusys
b4e4b30b8e
feat: migrate MediaPipe Pose to tools/script/pose/
...
遷移原因:
- 遵循 Tools 架構規範
- Worker 查找路徑為 tools/script/pose/
- 舊位置 scripts/ 將被清理
測試:
- ✅ Worker 能找到腳本
- ✅ 100% 檢測率
- ✅ 33 關鍵點
架構:
- tools/script/pose/pose_processor_mediapipe.py
- tools/script/pose/pose_processor.py
2026-09-28 01:11:08 +08:00
Accusys
8ab6802bff
feat: add MOMENTRY_CLI_DIR configuration
...
添加 CLI 工具路徑配置:
- admin_config.rs: 新增 cli_dir 字段和 get_cli_dir() 函數
- config.rs: 新增 CLI_DIR 常量
- 默認路徑: /Users/accusys/momentry_core_0.1/tools/cli
環境變數:
- MOMENTRY_SCRIPTS_DIR: Python 腳本路徑
- MOMENTRY_CLI_DIR: Swift/Rust CLI 工具路徑
文檔更新:
- tools/README.md: 環境變數配置說明
- AGENTS.md: 環境變數列表更新
2026-09-27 12:13:27 +08:00
Accusys
af028ab8f4
feat: restructure tools directory
...
新結構:
- tools/script/ (Python 處理器腳本)
- tools/cli/ (Swift/Rust CLI 工具)
遷移內容:
- Python 腳本: ASR, Face, Pose, Cut, OCR, VLM, Embedding, Identity
- Swift CLI: 24 個 Swift 處理器和測試文件
- Rust CLI: Face Cluster, Appearance, Pose
保留向後兼容:
- 舊路徑 scripts/ 仍然存在
- 環境變數可配置新路徑
文檔:
- tools/README.md
- docs_v1.0/DESIGN/Tools_Directory_Restructure.md
2026-09-27 12:04:23 +08:00