Loading face detection model… please wait. This needs internet once for the free MediaPipe model (CDN), then runs on-device.
Manual fallback — use these if face detection fails, or to fine-tune the fit:
How it works: MediaPipe Face Landmarker (free, Google, via CDN, no API key) finds your eyes on-device. The frame is scaled to your eye distance, rotated to your eye angle, and placed over your eyes.
Honest limitations — read before judging it:
1) JPG white background: These frames are JPGs on white, not transparent PNGs. This demo removes near-white pixels in the browser (threshold >240). That works fairly well for the black sunglasses, but edges can look rough, and very light / transparent lens areas (especially Blue Cut) can become patchy or see-through. It is not a perfect studio cutout. A real product needs a true transparent PNG or the supplier's cutout.
2) Face turn: This is flat 2D. It follows eye distance and tilt, but it does not turn in true 3D when you turn your head sideways — a 3D model would. Side views will look pasted on.
3) Fit is approximate: One size scale fits most faces, but bridge width and temple length are not measured here.
4) Camera needs HTTPS or localhost: Browsers block camera on plain http / file pages in many cases. Serve this file over HTTPS (or localhost) and allow camera permission.
Honest limitations — read before judging it:
1) JPG white background: These frames are JPGs on white, not transparent PNGs. This demo removes near-white pixels in the browser (threshold >240). That works fairly well for the black sunglasses, but edges can look rough, and very light / transparent lens areas (especially Blue Cut) can become patchy or see-through. It is not a perfect studio cutout. A real product needs a true transparent PNG or the supplier's cutout.
2) Face turn: This is flat 2D. It follows eye distance and tilt, but it does not turn in true 3D when you turn your head sideways — a 3D model would. Side views will look pasted on.
3) Fit is approximate: One size scale fits most faces, but bridge width and temple length are not measured here.
4) Camera needs HTTPS or localhost: Browsers block camera on plain http / file pages in many cases. Serve this file over HTTPS (or localhost) and allow camera permission.