- 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
- Identity agent: per-face max matching, multi-round with derived
seeds from high-confidence faces, angle diversity filter (cosine sim < 0.90)
- Pending person API: POST /file/:file_uuid/pending-person
+ GET /file/:file_uuid/pending-persons with status=pending, source=manual
- Update API docs (07_identity.md)