Skip to content

Promote to production: pas foto guide proportions + detection calibration - #303

Merged
slaveofcode merged 2 commits into
mainfrom
develop
Aug 21, 2026
Merged

Promote to production: pas foto guide proportions + detection calibration#303
slaveofcode merged 2 commits into
mainfrom
develop

Conversation

@slaveofcode

Copy link
Copy Markdown
Owner

Promotes the head-guide proportion fix (head-shaped outline, correct width in every photo size), the calibrated face-detection model, sequential model loading, and the wider vertical-position range. CI green on develop.

…ction

Three fixes from real-device feedback:

1. The oval was far too narrow. Its width came from the FRAME width while
   its height came from the crown/chin band, so in a 3x4 frame it rendered
   at a width/height of ~0.51 — nothing like a head, and a different shape
   in every photo size. The width is now DERIVED from the head height with
   an anatomical ratio (0.68), so the guide is head-shaped in 2x3, 3x4 and
   4x6 alike. The plain ellipse is replaced by headOutlinePath(), an egg
   shape with a rounded cranium tapering to the chin, and the SVG viewBox
   now matches the photo aspect instead of stretching a square one.

2. Framing feedback said 'looks good' while the subject was still too far
   away. HEAD_TO_FACE was a guessed 1.4; measuring a real detection (436px
   box vs a true 521px crown-to-chin, chin sitting above the box bottom)
   gives 1.20, split into CHIN_AT/CROWN_ABOVE so the chin is placed
   correctly too. A test pins the model to that measurement.

3. Background removal could fail with 'Failed to fetch' because the
   background-removal and face-detection models were downloaded at the
   same time; they now run in sequence.

Also widens the vertical-position range to +/-1 frame height: a test showed
a small (distant) face needs more travel than +/-0.5 allowed, which left
such photos misaligned.
fix(pas-foto): head guide proportions + calibrated face detection
@slaveofcode
slaveofcode merged commit 2906ca4 into main Aug 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant