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.…