This project implements a real-time drowsiness detection system that alerts drivers when signs of fatigue are detected. Using computer vision and facial landmark analysis, it monitors the driver’s eyes and classifies states as Active, Drowsy, or Sleeping. If drowsiness or sleep is detected for consecutive frames, an audible alarm is triggered to prevent accidents.
- Real-time face and eye detection from webcam video.
- 68-point dlib facial landmark predictor to track eye movement.
- Blink ratio (EAR-like metric) to detect open, drowsy, and closed eyes.
- Audible alerts when the driver is drowsy or sleeping.
- Live video feed overlay with eye status and landmarks.
Python OpenCV – video processing dlib – face detection and 68-point landmark predictor imutils, NumPy, SciPy – numerical and image utilities playsound – audio alerts
- Capture video frames via OpenCV.
- Detect faces using dlib’s HOG + Linear SVM detector.
- Extract eye landmarks from the 68-point model.
- Compute the eye aspect ratio (EAR): i. Eyes open → Active ii. Eyes slightly closed → Drowsy iii. Eyes closed for several frames → Sleeping
- Trigger audio alarms for Drowsy/Sleeping states.