This project has been completed by help from pyimagesearch.com
From the last project - Detecting facial landmarks - we know that we can apply facial landmark detection to localize important regions of the face, including eyes, eyebrows, nose, ears, and mouth. This also implies that we can extract specific facial structures by knowing the indexes of the particular face parts. In terms of blink detection, we are only interested in two sets of facial structures — the eyes.
Download or clone this repository on your local device and run the following command in the terminal while being in the Eye-blink-detection folder - python detect_blinks.py. If there's any package/module missing, you can easily install them using the pip command.
python3 detect_blinks.py --shape-predictor shape_predictor_68_face_landmarks.dat
- python3 detect_blinks.py --shape-predictor shape_predictor_68_face_landmarks.dat --video blink_detection_demo.mp4
- python3 detect_blinks.py --shape-predictor shape_predictor_68_face_landmarks.dat