fix/auto-match-stricter-filtering #35

Merged
tanyar09 merged 3 commits from fix/auto-match-stricter-filtering into dev 2026-02-10 13:29:26 -05:00
Collaborator
No description provided.
tanyar09 added 3 commits 2026-02-10 13:28:47 -05:00
backend/config.py - Added MIN_AUTO_MATCH_FACE_SIZE_RATIO = 0.005
backend/services/face_service.py - Multiple changes:
Added load_face_encoding() function (supports float32 and float64)
Added _calculate_face_size_ratio() function
Updated find_similar_faces() to filter small faces
Updated find_auto_match_matches() to exclude small reference faces
Fixed reference face quality calculation (use actual quality, not hardcoded 0.5)
Fixed duplicate detection (exclude faces from same photo)
Updated confidence threshold from 40% to 50%
Updated confidence calibration (moderate version)
backend/api/faces.py - Updated default tolerance to 0.5 for auto-match endpoints
backend/schemas/faces.py - Updated default tolerance to 0.5
admin-frontend/src/pages/AutoMatch.tsx - Updated default tolerance to 0.5
admin-frontend/src/api/faces.ts - Added tolerance parameter support
- Add debug mode support for encoding statistics in API responses
  - Debug info includes encoding length, min/max/mean/std, and first 10 values
  - Frontend logs encoding stats to browser console when debug enabled
  - Identify page enables debug mode by default

- Implement distance-based confidence thresholds for stricter matching
  - Borderline distances require higher confidence (70-95% vs 50%)
  - Applied when use_distance_based_thresholds=True (auto-match)
  - Reduces false positives for borderline matches

- Dual tolerance system for auto-match
  - Default tolerance 0.6 for regular browsing (more lenient)
  - Run auto-match button uses 0.5 tolerance with distance-based thresholds (stricter)
  - Auto-accept threshold updated to 85% (from 70%)

- Enhance pose detection with single-eye detection
  - Profile threshold reduced from 30° to 15° (stricter)
  - Detect single-eye visibility for extreme profile views
  - Infer profile direction from landmark visibility
  - Improved face width threshold (20px vs 10px)

- Clean up debug code
  - Remove test photo UUID checks from production code
  - Remove debug print statements
  - Replace print statements with proper logging
refactor: simplify developer mode to use environment variable
All checks were successful
CI / skip-ci-check (pull_request) Successful in 16s
CI / lint-and-type-check (pull_request) Successful in 59s
CI / python-lint (pull_request) Successful in 40s
CI / test-backend (pull_request) Successful in 3m57s
CI / build (pull_request) Successful in 3m36s
CI / secret-scanning (pull_request) Successful in 25s
CI / dependency-scan (pull_request) Successful in 21s
CI / sast-scan (pull_request) Successful in 1m40s
CI / workflow-summary (pull_request) Successful in 14s
cc74599959
- Replace localStorage-based dev mode with VITE_DEVELOPER_MODE env var
- Remove setDeveloperMode function and localStorage logic
- Update Settings page to show status instead of toggle
- Add VITE_DEVELOPER_MODE to vite-env.d.ts type definitions
- Update .env_example with developer mode documentation

Developer mode is now controlled by setting VITE_DEVELOPER_MODE=true
in admin-frontend/.env file (requires rebuild to take effect)
tanyar09 merged commit c5c3059409 into dev 2026-02-10 13:29:26 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ilia/punimtag#35
No description provided.