diff --git a/examples/blink_detection.py b/examples/blink_detection.py index a6c3568b1f2e31253a7f9ac243627b40d94e8556..bd5bbb62476581d954dd23014b0e8add4970f931 100644 --- a/examples/blink_detection.py +++ b/examples/blink_detection.py @@ -15,7 +15,6 @@ import face_recognition import cv2 import time from scipy.spatial import distance as dist -import keyboard as kb EYES_CLOSED_SECONDS = 5 @@ -74,8 +73,9 @@ def main(): while (asleep): #continue this loop until they wake up and acknowledge music print("EYES CLOSED") - if (kb.is_pressed('space')): + if cv2.waitKey(1) == 32: #Wait for space key asleep = False + print("EYES OPENED") closed_count = 0 process = not process