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

Fire click action with blinking #1

Open
wederfabricio opened this issue Jun 21, 2021 · 6 comments
Open

Fire click action with blinking #1

wederfabricio opened this issue Jun 21, 2021 · 6 comments
Labels
affects:desktop-app Affects the Electron app affects:web-library Affects usage of the tracky-mouse.js library enhancement New feature or request

Comments

@wederfabricio
Copy link

Hello @1j01 !

I was playing with your demo available in: https://1j01.github.io/tracky-mouse/

Congratulations for your studies in this topic, and for group these knowledge.

Is there any way to click with eyes or head movements?

@1j01
Copy link
Owner

1j01 commented Jun 25, 2021

I have implemented dwell clicking already (click by hovering in one spot), although it's not released in that demo yet.
Other clicking options like blink detection are planned, but I don't have any timeline for this project. Unfortunately this project is hard for me to work on due to serious health issues I have with my neck.

@wederfabricio
Copy link
Author

I'm sorry for your health issues.

I would like to implement this functionality, to click by blink. If you give more information like a lib to blink detection, I can implement this and submit a PR to your approval.

What do you think about this?

@1j01
Copy link
Owner

1j01 commented Oct 5, 2021

I don't think there are any good blink detection libraries out there, not with accurate detection.
I think I would try using Teachable Machine, with webcam images cropped around the head region (don't want to be too narrow in case the head tracking is laggy or inaccurate), possibly normalized in other ways.
I had some good initial success with it, with their web application where you can train directly from your webcam.
I got it to detect me blinking pretty well in under five minutes. Then I discovered cases where it didn't work, like moving significantly away from my starting head position. I tried training it more deliberately, giving it samples with different head positions and facial expressions. I don't think it got that much better...? But I think cropping could help a lot, so it focuses on the important parts (the eyes) and less on irrelevant background details.
If given a proper dataset of lots of open and closed eyes, it could be immediately usable for most people, and then the really interesting part is the user could be allowed to teach it new examples at runtime, based on their specific conditions (e.g. wearing novelty glasses, having a rare eye disease, rare eye color, and weird lighting all at once? it could happen! even while Black)

@wederfabricio
Copy link
Author

Awesome! I'm finishing some college projects now, I plan to resume this soon.

Thank you so much, you are making excellent progress.

@1j01 1j01 added enhancement New feature or request affects:web-library Affects usage of the tracky-mouse.js library affects:desktop-app Affects the Electron app labels Aug 4, 2022
@1j01
Copy link
Owner

1j01 commented Aug 11, 2022

An update: I've integrated dwell clicking into the desktop app (previously it was only part of the library).
I'm narrowing this issue down to focus on eye blink clicking support, and I'm opening an issue for mouth gestures: #25

@1j01 1j01 changed the title Fire click action with blinking or any way Fire click action with blinking Aug 11, 2022
@1j01
Copy link
Owner

1j01 commented Apr 14, 2024

The demo here looks like it tracks blinking well, so we may be able to update FaceMesh and detect blinks easily.

One minor detail: sometimes a fully closed eye isn't detected as fully closed, and an eye can be open and detected at a similar squinty level, however, if one eye is detected as fully closed, and the other eye is at that squinty level, I think it can be assumed that the squinty eye is open, and otherwise, if neither eye is detected as fully closed, then a squinty level can be assumed to be closed. So it might make sense to bias the blink detection, taking into account both eyes.
(When you blink one eye, you naturally squint with the other a bit, but not necessarily as much as the model reports. I think this physical phenomenon may have biased the model since eye blinking and opposite eye squinting are correlated.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:desktop-app Affects the Electron app affects:web-library Affects usage of the tracky-mouse.js library enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants