Real-time Driver Drowsiness & Yawning Detection using MediaPipe, OpenCV, and Text-to-Speech.
DriveAlert monitors a driverβs eyes and mouth through a webcam feed to detect signs of sleepiness or fatigue and issues both on-screen and voice alerts.
- Python: Main programming language.
- OpenCV: For video stream processing.
- MediaPipe: For robust facial landmark detection.
- NumPy: For efficient numerical computations.
- pyttsx3: For text-to-speech alerts.
- Real-time detection of drowsiness and yawning
- Works offline (no internet required)
- Voice alerts for better safety
- Easy to run on any webcam-enabled device
- Capture β The webcam feed is read in real-time using OpenCV.
- Detect Landmarks β MediaPipe detects facial landmarks (eyes, mouth).
- Calculate EAR & MAR β
- EAR < threshold β eyes closed for a certain duration β drowsiness alert.
- MAR > threshold β mouth wide open for a certain duration β yawn alert.
- Alert β Visual and voice alerts are triggered using pyttsx3.
git clone https://github.com/saichethana28/DriveAlert.git
cd DriveAlertpip install opencv-python mediapipe numpy pyttsx3python main.py
This project is licensed under the MIT License β see the LICENSE file for details.
Created by V. Sai Chethana π§ Email: saichethanavesireddy@gmail.com