Menu

Measuring 478 face landmarks locally with WASM and roll correction
📰

Measuring 478 face landmarks locally with WASM and roll correction

DEV Community: computervision·Brummond Cucufate·6 days ago
#IXxoHXge
Long article (960 words) — no AI summary yet.
Reading 0:00
15s threshold

A face overlay can look perfectly attached to a photo and still give the wrong eye angle. Draw a line through the corners of one eye, rotate the same image by ten degrees, and the line rotates with it. If a report changes simply because someone held the phone at an angle, the reported number belongs to the camera frame. The geometry needs its own reference frame.

A browser implementation has two jobs. First it has to run inference on the user's device, keeping the selected photo out of requests. Then it has to convert the detector's output into measurements that behave predictably when someone rotates or resizes the image. The second job can be tested with plain numbers. You can leave the model switched off.

Keep the crop and its dimensions together

For a single still, use MediaPipe Face Landmarker in image mode and read one face's landmark array. The task produces 478 estimated points per face, including the iris points. Keep the delivered indices and treat zero faces as a normal outcome.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.