- Add face_tracker.rs with core tracking algorithms
- Add trace_id field to Face struct
- Add metadata field to FaceResult struct
- Implement IoU, distance, and embedding similarity calculations
- Implement match_faces and track_faces functions
- Support scene cut detection
- Add unit tests for core functions
Test results:
✅ Swift Face: <1s (fast)
✅ Swift OCR: ~25s (RTF 2.5x)
✅ Whisper CLI ASR: 1m34s (accurate, multilingual)
⚠️ Swift ASRX: 20s (language limitation)
✅ CUT: <1s
Achievements:
- 50-90% reduction in startup time
- 17-97% reduction in processing time
- All processors working correctly
- JSON format compatible with Rust
Findings:
- ASRX has limited language support (Apple Speech Framework)
- Whisper CLI slower but more accurate
- Recommendation: Keep Python ASRX for broader language support
Test results:
- Swift OCR: ✅ Working (RTF 2.431x, no text detected)
- Whisper CLI: ⏳ Model downloading (461MB)
Swift processors (Face, OCR) successfully bypass Python wrapper.
Architecture validated: Swift + CLI tools + Rust layer.
- Modified ocr.rs to prioritize Swift binary over Python wrapper
- Swift OCR already compiled and tested
- Retained Python fallback for backward compatibility
- Created migration plan document for full Python → Rust transition
Phase 1 of processor architecture refactoring (user chose option C)
Related: once_cell::Lazy poisoning issue blocking Python processors
- src/bin/cleanup_orphan_vectors.rs: one-time tool to scan per-file Qdrant
collections (rule1/_faces/_scenes/_vlm/_seeds/face_embeddings/speaker),
dry-run support, delete points whose file_uuid is no longer registered.
Used to remove 53,122 orphan vectors across all production collections.
- docs: scene VLM search design suggestions for Studio team (8868 proxy)
- Lists all modified files with absolute paths
- Includes step-by-step instructions for Studio team
- Documents commits and expected results
- Provides troubleshooting guidance
** Purpose:
- Provide clear deployment instructions for Studio team
- Document the fix and required actions
- Enable quick verification steps
** Files Added:
- docs_v1.0/STUDIO_TEAM/2026-09-18_worker_deadlock_fix_handoff.md
- docs_v1.0/STUDIO_TEAM/README.md
** Key Points:
- Code fix committed (0fe09af)
- Worker binary needs rebuild
- Studio team should rebuild and redeploy
- Verification steps included
- 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).
- Add TraceArtifacts phase to TkgPhase enum (phase 18)
- Report progress as key_frame.jpg/key_face.jpg are created
- VLM trigger now polls until ALL key_frame.jpg files exist
(was: started after TKG build, before artifacts were ready)
- Add iron rule to AGENTS.md: ask before removing data
Tested: Gamma 8 (27 traces) → 27/27 VLM summaries completed
- validator::clamp_crop: clamp crop rect to frame dims (fixes OOB shift)
- tkg.rs: use clamp_crop in key_face crop paths (root-cause fix)
- trace_agent_api: POST /api/v1/file/:file_uuid/trace/:trace_id/regenerate-thumbnail
- docs: 26_trace_thumbnail_regenerate.md for Studio team
- Comprehensive guide for implementing hybrid filtering mode
- Includes architecture design with data layering
- Complete TypeScript code examples for all components
- Performance optimization strategies (LRU cache, lazy loading, virtual scroll)
- Best practices and common pitfalls to avoid
- Extension suggestions for future features
This document enables Studio team to implement the hybrid mode
efficiently with clear guidelines and examples.
- Comprehensive API usage guide for Studio team
- Includes all 6 API endpoints with examples
- Complete TypeScript code examples
- Filtering strategies and best practices
- Performance optimization recommendations
- Based on FaceNet analysis results from WD and KOBA videos
This document enables Studio team to integrate face filtering
functionality efficiently.
- Database: Added bbox_size column (min(width, height)) to face_filter_features
- API: Updated all endpoints to include bbox_size in responses
- Documentation: Added bbox_size explanation and frontend filtering examples
- Maintains current Swift implementation calculation method
- Enables efficient frontend filtering without backend threshold
This allows the frontend to do real-time filtering using bbox_size
while the backend pre-computes and stores the value.
- Database schema: face_filter_features and filter_rules tables
- Core engine: FilterEngine with 4 filter rules (landmark, mediapipe, embedding, temporal)
- API endpoints:
- GET /faces - Get faces with filtering
- GET /face/{id}/filter-report - Get filter report for single face
- POST /faces/filter - Apply filter rules
- GET /filter-stats - Get filter statistics
- GET/POST /filter-rules - Manage filter rules
- API documentation for Studio team with examples
- Based on FaceNet analysis results from WD and KOBA videos
- Completed FaceNet experiments on KOBA video (120 samples)
- Cross-video analysis confirms:
- Face size impact on stability is CONSISTENT (Large > Medium > Small)
- Bbox quality is CONSISTENT (Apple Vision ≈ MediaPipe)
- Recognition accuracy depends on video content
- Key recommendations:
- Minimum face size: 80px
- Bbox strategy: Apple Vision (default) or MediaPipe (efficient)
- Quality metric: Minimum similarity > 0.70
- Based on 240 total samples across 2 videos
- Completed 3 experiments using real FaceNet model (Inception ResNet V1)
- Key findings:
- Large faces (>150px) have highest stability (0.9995)
- Apple Vision and MediaPipe bboxes produce identical quality (0.899)
- Face size affects recognition accuracy lower bound (0.760 vs 0.648)
- Recommendations:
- Minimum face size: 80px
- Ideal face size: >150px
- Both AV and MP bboxes are acceptable
- Included detailed comparison with simplified model results
- Completed 3 experiments on WD video with 120 samples
- Key findings:
- Apple Vision bbox produces higher quality embeddings (0.841 vs 0.748)
- MediaPipe bbox is more precise but lower quality
- Recommendation: Use Apple Vision bbox for embedding calculation
- Included detailed methodology, results, and recommendations
- Suggested bbox selection strategy and size filtering thresholds
- Tested confidence thresholds: 0.1, 0.2, 0.3, 0.4, 0.5
- Key finding: 0.3 is optimal threshold
- Zero false positives (correctly rejects frames 671, 1116)
- Same detection rate as 0.5 (100%)
- More permissive than 0.5, may detect more faces in other videos
- Recommendation: Use 0.3 as default min_confidence for MediaPipe
- Updated dual-source filtering strategy:
- Apple Vision: primary detector (min_confidence=0.5, min_size=1)
- MediaPipe: verifier (min_confidence=0.3)
- Upgraded MediaPipe from 0.10.35 to 1.0.0
- Re-ran same frame comparison experiment
- Key finding: MediaPipe 1.0.0 and 0.10.35 have identical performance
- Both versions: 2.5% recall, 100% precision (zero false positives)
- Apple Vision: 96.1% recall, 0% precision (3 false positives)
- Conclusion: MediaPipe is very conservative but reliable for false positive rejection
- files.rs: register_file now converts FaceSettings to json and passes to create_monitor_job
- processing.rs: ProcessRequest now includes face_settings field
- processing.rs: trigger_processing now passes face_settings to create_monitor_job and updates existing jobs
- docs: updated API examples to use correct endpoints (/api/v1/files/register and /api/v1/files/:uuid/process)
- Complete guide for FACE_MIN_CONFIDENCE and FACE_MIN_SIZE configuration
- Includes environment variable setup (shell export + launchd plist)
- API parameter examples with curl commands
- Log verification steps for all three layers (Rust/Python/Swift)
- Recommended values for different scenarios
- Database schema documentation
- FAQ section for common issues
Added Core API optimizations already deployed:
- Thumbnail API uses pre-cached key_face.jpg (8ms vs 500ms)
- Face-groups API supports ?include_trace_ids=false (-48% payload)
Updated Studio instructions to use these new endpoints.
Document for Studio team to implement lazy loading + concurrency increase
for face group thumbnail loading. Expected improvement: Charade load time
from ~76s to <2s.
- profile.rs: single/group/merge_groups/undo all use upsert_trace_profile
- trace_agent_api.rs: hard delete/merge snapshot + delete trace_profiles
- cluster_agent.rs, job_worker.rs: background name writes use UPSERT
- schema.rs: upsert_trace_profile helper (backfill from tkg_nodes)
- Studio 3 API gaps documented (cluster-results/identity-matches/similar)
- 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
- Add [OCR], [ASRX], [ASRX+OCR] prefix to text_content
- Add content field to SemanticSearchResult struct
- Update SQL queries to include content field
- Helps users distinguish the source of search results
- tkg_nodes has no edge_type column, query was failing silently
- Split into count_nodes(node_type) and count_edges(edge_type)
- Fixed text_region → text_trace node type name
- Also: OCR frame fix in rule1 (end_frame computed from end_time+FPS)
- skin_tone is a person attribute (like height), not trace attribute
- Remove build_skin_tone_trace_nodes function
- Remove skin_tone_trace_nodes from TkgResult and API response
- Remove skin_tone_trace from documentation tables