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

Blink detection fix #1118

Merged
merged 2 commits into from
Sep 26, 2020
Merged

Blink detection fix #1118

merged 2 commits into from
Sep 26, 2020

Conversation

ariyapour
Copy link
Contributor

In the blink detection script, there were 2 problems.
The first problem was quitting the script. Since the cv2.waitKey() was inside the for loop that processes the facial landmarks, we can not quit the script. It should be moved outside the for loop. I assigned "q" for exiting the script.
The second problem was the keyboard module. Using keyboard module in Linux causes the following error: "ImportError: You must be root to use this library on linux."
I replaced kb.is_pressed('space') with cv2.waitKey(1) == 32

Set q for exiting the program. Move cv2.waitKey() outside the for loop that detects face landmarks.
Using the keyboard module in linux requires root permission and if virtual envs are used to run the script, it will produce the following error:

ImportError(You must be root to use this library on linux.)

To solve this, use OpenCV waitKey() functionality.
@ageitgey
Copy link
Owner

Thanks!

@ageitgey ageitgey merged commit 186d64d into ageitgey:master Sep 26, 2020
@ariyapour ariyapour deleted the blink-detection-fix branch November 12, 2020 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants