feat: implement real MediaPipe face mesh landmarks for improved glasses fitting (Fixes #2) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #134
Open
waterWang wants to merge 2 commits into
Conversation
added 2 commits
July 25, 2026 02:01
- Add PD calibration wizard modal with credit card reference measurement - Add calibrateFromReference() and estimatePd() math functions - Add visual calibration UI with measure-from-face button - Add 7 unit tests for calibration math (all pass) - Add REFERENCE_CARD_WIDTH_MM constant (85.6mm, ISO/IEC 7810) Fixes mergeos-bounties#7
…es fitting (Fixes mergeos-bounties#2) - Add faceMetricsFromMesh() using 478 MediaPipe landmarks vs 2-point fallback - Use iris center, inner/outer eye corners, nose bridge, and face contour - Store full landmarks array on face object for mesh-based metrics - Update overlay.js to prefer mesh-based metrics when available - Clear landmarks on demo/geometric fallback transitions - Show landmark count in tracking badge (e.g. 'tracking: mediapipe · 478 pts') - Keep geometric fallback working offline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements real MediaPipe Face Mesh landmarks for glasses fitting, moving beyond the 2-point geometric fallback to use the full 478-point mesh from MediaPipe.
What changed
packages/tryon-js/src/fit.js
packages/tryon-js/src/overlay.js
packages/web/assets/app.js
Geometric fallback still works
When MediaPipe is unavailable (offline/CDN blocked), the app falls back to the existing geometric method with no changes.
Acceptance
Closes #2