• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

galthran-wq / face-recognition-service / 25000569250

27 Apr 2026 02:21PM UTC coverage: 88.802% (+14.4%) from 74.407%
25000569250

push

github

web-flow
Pad square fallback (#5)

* Expose 5-point landmarks in detect/embed/analyze responses

Populates the `landmarks` field on DetectedFace from the kpss returned by
the SCRFD detector, and serializes them as LandmarkPoint objects in the
API response. Enables clients to perform landmark-based checks (e.g.
face orientation sanity) without running their own face detector.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Pad-to-square fallback when detector returns zero faces

RetinaFace anchors miss faces that fill most of the frame. On a miss,
pad the image to a square with a 100px gray border and re-run detection
once. Translate bbox/landmark coordinates back to the original frame
(clipping bboxes to the original dimensions) so callers never see
padded coordinates.

Applied uniformly to detect/embed/analyze and the embed_batch /
analyze_batch paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Make pad-fallback border/fill configurable; add review follow-up tests

Review follow-ups on pad-square-fallback:
- Move border_px / fill from module constants to config + provider ctor
  (face_pad_fallback_border_px, face_pad_fallback_fill).
- Add test that alignment receives the padded canvas, not the original
  (regression guard: silently using `img` instead of `working` would
  pass earlier tests).
- Mirror embed_batch fallback test for analyze_batch.
- Add test asserting non-default border/fill flow through to the canvas.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

81 of 85 new or added lines in 5 files covered. (95.29%)

571 of 643 relevant lines covered (88.8%)

0.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.48
/src/api/endpoints/faces.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc