Skip to content

About

Real-time driver drowsiness detection system using Computer Vision (OpenCV & MediaPipe). Detects eye closure, yawning, and head drooping with smart multi-signal fusion to minimize false alarms. Includes audio alert and session logging.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Sleepy Driver Detection System

A real-time driver drowsiness detection system built using Computer Vision that monitors the driver's face through a webcam and triggers an audio-visual alert when signs of drowsiness are detected.


Problem Statement

Drowsy driving is one of the leading causes of road accidents worldwide. This system continuously monitors the driver and alerts them before a dangerous situation occurs.


How It Works

The system uses three signals combined together (multi-signal fusion) to detect drowsiness:

  • EAR (Eye Aspect Ratio) detects eye closure and slow drooping
  • MAR (Mouth Aspect Ratio) detects yawning
  • Head Pose Estimation detects head drooping forward

A single signal alone does not trigger the alarm, the system is smart enough to avoid false alarms from blinking, laughing, talking to passengers, or looking at the dashboard.


Tech Stack

  • Python 3.11
  • OpenCV
  • MediaPipe
  • NumPy
  • SciPy
  • Pygame

Features

  • Real-time face, eye, and mouth tracking
  • Multi-signal fusion to minimize false alarms
  • Audio alarm when drowsiness detected
  • Visual HUD overlay with live EAR, MAR, and head angle
  • Pause/Resume detector with P key
  • Automatic session logging with timestamps

How to Run

1. Install dependencies:

pip install opencv-python mediapipe numpy scipy pygame

2. Place alarm.wav in the same folder as detector.py

3. Run the detector:

python detector.py

Controls:

Key Action
P Pause / Resume
Q Quit

About

Real-time driver drowsiness detection system using Computer Vision (OpenCV & MediaPipe). Detects eye closure, yawning, and head drooping with smart multi-signal fusion to minimize false alarms. Includes audio alert and session logging.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages