Hacker News new | past | comments | ask | show | jobs | submit
Hell yeah, this is great. I made a similar, but much worse, thing a while back

https://jammaloo.com/DealWithIt/

It uses face-api.js to find the face, and then move the sunglasses over it. It's about a 5 meg model, so it's pretty slow to load. You can customize with a URL, or drag and drop an image on. Resizing the browser also moves the glasses around.

Very happy to see someone take the idea way way way further!

Heck yeah! Love the touches like resize handling or rotation support! Contributions are more than welcome... hint hint ;)

> It uses face-api.js to find the face

Yeah, I'm using Google AI's Face Detector [1]. There's Tensorflow's Face Landmarks Detection [2] that looked most promising and accurate. But it had two bugs [3][4] that are blockers. The first one got fixed recently, but the other one is still pending.

[1] https://ai.google.dev/edge/mediapipe/solutions/vision/face_d...

[2] https://github.com/tensorflow/tfjs-models/tree/master/face-l...

[3] https://github.com/tensorflow/tfjs/issues/7905

[4] https://github.com/tensorflow/tfjs/issues/8290