Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

face liveliness test by blinking eye #2313

Closed
ersaurabh101 opened this issue Jul 20, 2021 · 10 comments
Closed

face liveliness test by blinking eye #2313

ersaurabh101 opened this issue Jul 20, 2021 · 10 comments
Assignees
Labels
legacy:face mesh Issues related to Face Mesh platform:javascript MediaPipe Javascript issues type:research Model specific questions

Comments

@ersaurabh101
Copy link

I am looking at this demo - https://storage.googleapis.com/tfjs-models/demos/face-landmarks-detection/index.html

How can i get a trigger when eye is blinked ?

If you can provide me any direction , it will be very helpful.

@sgowroji sgowroji added legacy:face mesh Issues related to Face Mesh stat:awaiting response Waiting for user response type:support General questions labels Jul 20, 2021
@sgowroji
Copy link

Hi @ersaurabh101, Could you please point us the MediaPipe use case in the above demo. Thanks!

@ersaurabh101
Copy link
Author

Use case will be attendance capture, Before capturing i need to ensure, its human not a picture

@sgowroji sgowroji added the platform:javascript MediaPipe Javascript issues label Jul 20, 2021
@sgowroji
Copy link

Can you share your code changes which include MediaPipe scripts to understand the issue much better. Thanks!

@ersaurabh101
Copy link
Author

I tried to use this code but it doesnt trigger any message in console, if you can help and get it to work or something similar - https://gist.github.com/kleysonr/d75494f239ad0dce561a55a624920693

I just need a valid trigger on blink.

@sgowroji
Copy link

Hi @ersaurabh101, I don't see any MediaPipe CDN scripts added in the codebase. And facemesh is taken from tensorflow model as stated below. @tyrmullen Does this need any support from MediaPipe.

<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/face-landmarks-detection@0.0.2/dist/face-landmarks-detection.min.js"></script>

@sgowroji sgowroji added stat:awaiting googler Waiting for Google Engineer's Response and removed stat:awaiting response Waiting for user response labels Jul 20, 2021
@sgowroji sgowroji assigned tyrmullen and unassigned sgowroji Jul 20, 2021
@ersaurabh101
Copy link
Author

I am sorry for that, I tried to tell you what i am doing and what i need to achieve. I came to mediapipe from here- https://blog.tensorflow.org/2020/11/iris-landmark-tracking-in-browser-with-MediaPipe-and-TensorFlowJS.html

I just need help , want to catch when eye blinks, if possible. If not , you can close this
Regards

@sgowroji
Copy link

I would recommend you to use face mesh Javascript solution. Eye blinking you can notice this point regarding the face mesh. Let us know if you are looking for anything more.

@sgowroji sgowroji added type:research Model specific questions and removed type:support General questions labels Jul 20, 2021
@kostyaby
Copy link

Hey @ersaurabh101,

I tried to use this code but it doesnt trigger any message in console, if you can help and get it to work or something similar - https://gist.github.com/kleysonr/d75494f239ad0dce561a55a624920693

Unfortunately, I can't help you with other person's code. Please, contact that person directly to get a fix

How can i get a trigger when eye is blinked ?

That can be done using MediaPipe JS solution mentioned by @sgowroji (please, explore the links in #2313 (comment)). To detect if someone blinked, you probably need to work with landmarks from the FACEMESH_LEFT_EYE and FACEMESH_RIGHT_EYE contours. For each eye, please pick face mesh landmarks on both vertical and horizontal edges of the eye. Then, compute the distance ratio between the vertical / horizontal edge segments - that ratio will be a good target for thresholding in a heuristic. I can't tell you specifics now as I didn't play with exact values, but there will probably be a different confidence interval of the horizontal_edge_segment / vertical_edge_segment expression value when an eye is closed and it is open - you can use that to detect whether there was a blink or not.

Sorry for the lack of specifics, hopefully this rough outline of one possible algorithm is a good starting point for your project!

@sgowroji sgowroji added stat:awaiting response Waiting for user response and removed stat:awaiting googler Waiting for Google Engineer's Response labels Jul 23, 2021
@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:face mesh Issues related to Face Mesh platform:javascript MediaPipe Javascript issues type:research Model specific questions
Projects
None yet
Development

No branches or pull requests

4 participants