justadudewhohacks / face-api.js

JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js
MIT License
16.38k stars 3.66k forks source link

Detecting closed eye from webcam feed #660

Open sundar505 opened 4 years ago

sundar505 commented 4 years ago

Thanks for this awesome library.

I want to detect when user closes the eyes. I highly appreciate if I get code example.

karthik-Gopalan commented 4 years ago

I am not sure there is an API in face-api for this. All the relevant examples possible are given in the examples folder. Not seen one for eye lid detection. This is more aimed at the face itself.

yash-sr commented 4 years ago

You can use face landmark for eyes, and then find the vertical distance between the eyelids to recognize blink or closed eyes.

roshande commented 3 years ago

You can use face landmark for eyes, and then find the vertical distance between the eyelids to recognize blink or closed eyes.

No the model doesn't recognise whether eye is closed. The landmarks just show the position of eye.

madi1990 commented 2 years ago

You can use face landmark for eyes, and then find the vertical distance between the eyelids to recognize blink or closed eyes.

No the model doesn't recognise whether eye is closed. The landmarks just show the position of eye.

I am facing this issue now. The distance doesn't make too much difference when eyes are open and then closed. Just wondering what you did to address it.