Loading repository data…
Loading repository data…
TheNsBhasin / repository
A Python script to detect driver drowsiness in a real-time and sound an alarm if driver appears to be drowsy
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A Python script to detect driver drowsiness in a real-time and sound an alarm if driver appears to be drowsy.
pip install -r requirements.txt
python detect_drowsiness.py \
--shape-predictor shape_predictor_68_face_landmarks.dat \
--alarm alarm.wav
A computer vision system that uses a real-time algorithm to detect eye blinks in a video sequence from a standard camera and sound an alarm if the driver appears to be drowsy.
Given an input image (and normally an ROI that specifies the object of interest), a shape predictor attempts to localize key points of interest along the shape. Detecting facial landmarks is therefore a two step process:

Now, each eye is represented by 6 (x, y)-coordinates, starting at the left-corner of the eye (as if you were looking at the person), and then working clockwise around the eye:

For every video frame, the eye landmarks are detected. The eye aspect ratio (EAR) between height and width of the eye is computed. If the eye aspect ratio value is less than a threshold value for sufficient time, an alarm is set to wake up the driver.

