Files
oak-service/face_recognition.py
Alex 19a27a1240 Fix face detection: letterbox resize, smart cropping, throttle
- Use letterbox resize (preserve aspect ratio + pad) instead of stretching
  to 320x320. Stretching 16:9 frames caused faces to be undetectable.
- Auto-detect score tensor output index at init time (name + variance heuristic)
- Smart upper-body crop: roughly square region instead of thin wide strip
- Throttle face detection to every 2s to reduce Coral USB traffic
- Skip crops smaller than 80px (too small for reliable detection)
- Reduce log level from DEBUG to INFO

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 14:05:44 -06:00

13 KiB