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: [email protected]