Commit Graph

28 Commits

Author SHA1 Message Date
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 e84d92d52c fix: remove hardcoded path in facenet_embedding.swift (A-4.2)
Problem:
- L24 had hardcoded model path as default_value
- Would cause D-4 failure (strings shows dev path)

Solution:
- Remove default_value
- Add runtime resolution:
  1. CLI --model argument
  2. MOMENTRY_MODELS_DIR env var
  3. Sibling of binary (models/facenet512.mlpackage)

Impact:
- Swift CLI now portable
- No dev path strings in binary
- D-4 Gate condition satisfied

Verification: grep shows 0 hardcoded paths
2026-10-04 19:31:51 +08:00
Accusys 3399a137d8 fix: resolve FaceNet model path at runtime (A-4.2 P1, A-11, A-12)
Issues:
- facenet_embedding.swift:28 hardcoded model path
- face.rs:227-231 did not pass model path parameter
- face.rs:249-255 only logged warnings, causing silent degradation
- M4ProMini missing facenet512.mlpackage → embeddings all None → TKG 0 nodes

Changes:
1. facenet_embedding.swift:
   - Add --model option (default: models/facenet512.mlpackage)
   - Validate model file exists before loading
   - Print clear error message if missing

2. face.rs:
   - Use path_utils::resolve_asset_path for models dir
   - Pass --model argument to facenet_embedding
   - Validate model exists before running
   - Elevate errors from warn! to error! + bail!
   - Fail fast on embedding generation failure

Benefits:
- Runtime resolution via MOMENTRY_MODELS_DIR
- No silent degradation - missing model causes explicit error
- Clear error messages guide users to fix

Verification:
- cargo check --lib passes
- swift build -c release passes

Next steps:
- Add facenet512.mlpackage to release delivery (A-11 requirement 3)
- Update smoketest to verify embeddings != None (A-5.3)

References:
- A-4.2 P1 in Momentry_Release_Requirements_20261004.md v1.1
- A-11, A-12
- 020.mp4 diagnosis (appendix C)
2026-10-04 14:37:49 +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 e95cdcc673 fix: add bbox validation in Swift Face processor
問題:
- Face detection 輸出無效 bbox (width=0, height=0)
- 導致 face tracing 失敗
- 所有 faces trace_id = -1

修復:
- ✅ 添加 bbox 驗證邏輯
- ✅ 過濾 width <= 0 或 height <= 0 的 bbox
- ✅ 添加警告日誌
- ✅ 修復 swift_face_pose.swift 類型錯誤

影響文件:
- scripts/swift_processors/swift_face.swift
- scripts/swift_processors/swift_face_pose.swift

狀態: ✅ 已修復,需要重新處理受影響的文件
2026-09-29 01:03:54 +08:00
Accusys 357e585399 fix: Face processor now saves status and total_faces to face.json 2026-09-26 23:06:11 +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 9ffbfeb6c5 feat: OCR resolution optimization - native resolution up to 1920px
- Replace fixed 320px downscale with smart resolution handling
- Videos <= 1920px: use native resolution (no downscale)
- Videos > 1920px: downscale to 1920px width
- Improves OCR quality for small text, subtitles, and scene text

Before: All videos scaled to 320px → poor OCR for small text
After: 1080p/720p videos use native resolution, 4K scales to 1920px

Verified: swift_ocr binary builds and runs correctly
- 720x890 video: native resolution (no scaling)
- 1920x1080 video: native resolution (at threshold)
- Detects video width and applies conditional scaling

Note: PaddleOCR fallback (ocr_processor_mps.py) already uses native resolution
2026-09-17 22:18:33 +08:00
Accusys 5e6a7b7d51 feat: round output JSON floats to 2dp + unify ensure_ascii for asr/asrx 2026-08-16 06:38:39 +08:00
Accusys 39e9ce4c3b fix: add min_capture_quality to FaceFilterSettings + trace profile fixes
- Add min_capture_quality to FaceFilterSettings (file_profile.rs)
- Fix store_traced_faces.py: load embeddings from Qdrant with_vector=True
- Fix face_tracker.py: force new traces when frame_gap > 30
- Fix backfill_trace_profiles.py: key_frame select=eq(n,N), bbox scaling, best_frame
- Add best_frame to FaceTraceProfile (Rust + Python)
- Fix min_capture_quality persistence in file-profile API
2026-08-13 10:12:21 +08:00
Accusys 71172fa354 fix: separate confidence and captureQuality in face detection output
Apple Vision provides two distinct scores:
- confidence: detection confidence (is this a face?)
- faceCaptureQuality: capture quality (is this face suitable for recognition?)

Previously these were mixed together as 'confidence'. Now both are
stored separately in the output JSON for downstream use.
2026-08-12 11:51:10 +08:00
Accusys 8dada662e8 fix: add parameter logging for face detection settings
- swift_face.swift: Log MIN_CONFIDENCE and MIN_SIZE at startup
- face_processor.py: Log settings passed to swift_face subprocess
- executor.rs: Log face settings being passed to Python subprocesses (4 run methods)
- Enables debugging of face detection parameter chain

Test results:
- FACE_MIN_CONFIDENCE=0.5, FACE_MIN_SIZE=1 → 392 faces (195 frames with 2 faces)
- SwiftFace log shows: MIN_CONFIDENCE=0.5, MIN_SIZE=1
- face_processor.py log shows: Settings passed to swift_face: FACE_MIN_CONFIDENCE=0.5, FACE_MIN_SIZE=1
2026-08-08 16:10:47 +08:00
Accusys 256e872fd9 fix: swift_face.swift reads MIN_CONFIDENCE and MIN_SIZE from env vars
- FACE_MIN_CONFIDENCE env var (default 0.75)
- FACE_MIN_SIZE env var (default 64)
- Allows per-file threshold configuration via environment
2026-08-08 04:19:45 +08:00
Accusys 3d13a06bd9 feat: face fix deployment + trace_* regeneration + executor stderr filter fix
- swift_face.swift: frame rounding (.rounded()), conf 0.75, min_size 64
- trace_* directories regenerated for KOBA (37 traces, start_frame 5307)
- executor.rs: stderr filter now logs all non-empty stderr (was discarding)
- VAD not skippable in ASRX (main_fixed.py Step 2 always runs)
- Step 2.5 sentence boundary refinement added
- Cluster agent async endpoints + similarity transparency
- Keyword search: relationship text extraction, priority ordering
- Face fix handoff doc for Studio team
2026-08-05 00:13:50 +08:00
Accusys 39a2cbc65b fix: face group name read consistency, sync_file_status fix, cleanup ghost records, identity_agent replaced with face_dedup
- get_face_groups_handler: COALESCE(tp.name, tn.label) for name consistency
- sync_file_status: compare JSON vs pre_chunks (not chunk table)
- face consistency: compare frames.len() not total_faces
- cleanup 2 ghost records with NULL file_name/file_path
- replace identity_agent with face_dedup in pipeline stages
- remove identity_agent_api.rs and all references
- update required_processors to match actual processors
- update AGENTS.md with team responsibilities
- add Studio pipeline changes documentation
2026-07-27 02:15:51 +08:00
Accusys 3eabd45882 fix: ASRX duplication, TKG edges, trace ingest, and add pipeline progress publishing
- ASRX handler no longer stores duplicate 'asr' pre_chunks
- Pre_chunks storage made idempotent (delete-before-insert)
- Rule 1 + trace_ingest changed to query 'asrx' not 'asr'
- Trace chunks removed (dynamic from TKG/Qdrant)
- TKG scroll_face_points fixed: trace_id >= 1 (not == 1)
- TKG AsrxSegmentEntry: start/end -> start_time/end_time (match ASRX JSON)
- Unregister error handling: log instead of silent discard
- Add publish_pipeline_progress calls at each pipeline stage
  (processors, rule1, face_trace, identity_agent, TKG, rule2, completion)
2026-07-02 10:43:46 +08:00
Accusys 766a1d9a6d feat: Swift Face Pose integration + TKG 方案 B
Major Changes:
- swift_face_pose: output pose angles (yaw/pitch/roll) in face.json
- face_processor.py: call swift_face_pose (dual output: face.json + pose.json)
- Face struct: add pose_angle field
- TKG 方案 B: gaze/lip_track nodes from face.json (no face_detections dependency)
- Chunk cleanup: delete old data before rebuild (avoid duplicate key)
- Hand nodes: classify by hand_type + gesture (15 combinations)
- HAND_OBJECT edges: bbox spatial matching (174 matches)

Test Results:
- Blake Jones: 8 faces, pose_angle ✓, 66 nodes, 174 edges
- FilmRiot: 394 faces, pose_angle ✓, 35 nodes, 39 edges
- Left hands: 132, Right hands: 2

Architecture:
- All TKG nodes built from JSON files (face.json, hand.json, yolo.json)
- Swift processors: sample_interval=3 (Face/Pose/Hand sync)
- Cleanup functions: delete_tkg_nodes_by_uuid, delete_tkg_edges_by_uuid
2026-06-23 05:47:24 +08:00
Accusys 7e548f8b08 release: v1.3.0 - TKG node type renaming
Changes:
- Rust: face_trace → face_track (45 occurrences in 8 files)
- Rust: gaze_trace → gaze_track, lip_trace → lip_track
- Python: tkg_builder.py unified + pipeline_checklist.py fixed
- Swift: swift_hand.swift hand state detection (empty vs holding)

Node type changes:
  face_trace    → face_track
  person_trace  → body_track
  gaze_trace    → gaze_track
  lip_trace     → lip_track
  hand_trace    → hand_track
  speaker       → speaker_segment
  object        → detected_object
  text_trace    → text_region

Migration:
  PUBLIC schema: 12970 + 892 + 305 rows updated
2026-06-22 07:18:21 +08:00
Accusys 2cfcfdd1af feat: Phase 2.6 edges migration to Qdrant (TKG-only architecture)
Phase 2.6.1: co_occurrence_edges migration
- build_co_occurrence_edges_from_qdrant()
- Qdrant embeddings → frame grouping → YOLO objects
- Result: 6679 edges (vs 6701 PostgreSQL)

Phase 2.6.2: face_face_edges migration
- build_face_face_edges_from_qdrant()
- Qdrant embeddings → frame grouping → face pairs
- mutual_gaze detection preserved
- Result: 6 edges (exact match)

Phase 2.6.3: speaker_face_edges migration
- build_speaker_face_edges_from_qdrant()
- Qdrant embeddings → trace_id frame ranges
- SPEAKS_AS edge creation

Architecture:
- All edges use Qdrant payload (no face_detections queries)
- PostgreSQL fallback for empty Qdrant
- Estimated 3.6x performance improvement

Testing:
- Playground (3003): ✓ All Phase 2.6 logs verified
- Edge counts: ✓ Close match with PostgreSQL
- Fallback: ✓ Working

Docs:
- docs_v1.0/DESIGN/TKG_PHASE2_6_EDGES_MIGRATION.md
- docs_v1.0/M4_workspace/2026-06-21_phase2_6_test.md
2026-06-21 04:47:49 +08:00
Accusys e1572907ae feat: ASRX hybrid pipeline, identity history, worker fixes, checkpoint system 2026-06-02 07:13:23 +08:00
M5Max128 29eabf6d88 chore: remove swift build artifacts from tracking 2026-05-25 03:37:19 +08:00
Accusys c41f7e0c6e feat: schema version tracking, SHA256 integrity, setup scripts, bug fixes 2026-05-15 18:06:36 +08:00
Accusys c90394897d fix: trace debug — show Stranger_NNN for unnamed traces instead of unknown 2026-05-14 15:12:21 +08:00
Accusys ffc30d7377 M4 handover: coordinate fixes, detector registry, deploy v2, YOLOv8s, identity lifecycle
- Fix swift_pose/swift_ocr Y-flip bugs (BUG-003~006)
- Add heuristic_scene module + post-processing trigger (replaces Places365)
- YOLOv5nu → YOLOv8s CoreML (+33% detections, +390% scene indicators)
- Per-table SQL export (split 4.7GB single file → 478MB max per table)
- Version/build check in deploy.sh (compare /health vs file_info.json)
- Add file_uuid column to identities table + backfill
- Identity pre-clean step in deploy (avoids UNIQUE conflicts on re-deploy)
- Stranger_xxx naming fix with UUID context
- Add DETECTOR_REGISTRY.md (25 detectors), DETECTOR_SELECTION_SOP.md
- Update SPATIAL_COORDINATE_REGISTRY.md (P layer, 6-layer architecture)
- New IDENTITY_LIFECYCLE.md
- M4 response docs for deploy_script_fix and 111614 test report
2026-05-13 20:00:47 +08:00
Accusys 48c3b13c37 fix: restore identity_id after face_dedup, rebuild package v20260512
- Re-ran identity_bind.py to restore identity_id on face_detections
- Dedup cleanup had removed rows with identity_id, kept NULL rows
- 70691 face_detections now have identity_id, 428 identities
- Full package rebuild: 169MB sqlite, 1358MB tar.gz
- identities.json: 428 identities + 5483 bindings + 5483 trace maps
- TMDB matching complete: Audrey Hepburn 843 traces, Cary Grant 482
2026-05-13 04:30:18 +08:00
Warren 65a1f77e65 feat: trace quality agent selection report, identity clustering runner_v2 DB write, age/gender CoreML selection, updated experiment config UUID 2026-05-06 14:41:48 +08:00
Warren 74b6182eba feat: media API (video/bbox/thumbnail), UUID unification, dot matrix text, portal fixes, API dictionary V1.3 2026-05-06 13:34:49 +08:00
Warren e75c4d6f07 cleanup: remove dead code and duplicate docs
- Remove session-ses_2f27.md (161KB raw session log)
- Remove 49 ROOT_* duplicate files across REFERENCE/
- Remove 14 duplicate files between REFERENCE/ root and history/
- Remove asr_legacy.rs (dead code, replaced by asr.rs)
- Remove src/core/worker/ (duplicate JobWorker)
- Remove src/core/layers/ (empty directory)
- Remove 4 .bak files in src/
- Remove 7 dead private methods in worker/processor.rs
- Remove backup directory from git tracking
2026-05-04 01:31:21 +08:00