Face-api.js: Can I detect the pupil position?

Created on 12 Oct 2019  Â·  6Comments  Â·  Source: justadudewhohacks/face-api.js

Can I detect the pupil position through this library?it's possible?

solution provided

Most helpful comment

Not the pupil, but the average of position 37 and 40 of the 68 point Face Landmark Detection will give you center of one eye, and the average of position 43 and 46 will give you the center of the other eye. The pupil may not be there, but it is the most typical position.

All 6 comments

face-api.js does not provide a model to detect the pupil position, no.

Not the pupil, but the average of position 37 and 40 of the 68 point Face Landmark Detection will give you center of one eye, and the average of position 43 and 46 will give you the center of the other eye. The pupil may not be there, but it is the most typical position.

face-api.js does not provide a model to detect the pupil position, no.

OK ! Thank you very much.~

Not the pupil, but the average of position 37 and 40 of the 68 point Face Landmark Detection will give you center of one eye, and the average of position 43 and 46 will give you the center of the other eye. The pupil may not be there, but it is the most typical position.

Thank you very much.~

in addition to @seattleacademy 's solution: you can also use methods landmarks.getLeftEye() and landmark.getRightEyes() from FaceLandmarks68 class. I believe the methods return an array of 6 points for each eye then you can get the average x,y values from those 6 points and maybe use it as the pupil position.

@armno Thank you first. But what I want is to be able to detect the moving pupil, not the middle point. thanks all the same~~

Was this page helpful?
0 / 5 - 0 ratings