Detect sleep and drowsiness in real-time video streams using advanced computer vision techniques with OpenCV and Mediapipe.
This project monitors facial landmarks and eye closure patterns to detect signs of sleep and drowsiness. Leveraging OpenCV for video capture and Mediapipe for facial landmark detection, it provides an accurate and efficient solution for driver safety, productivity monitoring, and wellness applications.
- Real-time face and eye tracking
- Automatic detection of prolonged eye closure or drowsiness
- Visual and audible alerts for sleep detection
- Easy integration and customization
- Python
- OpenCV
- Mediapipe
- SciPy
- Capture live video feed using OpenCV.
- Analyze face and eye landmarks with Mediapipe's Face Mesh.
- Calculate eye aspect ratio to detect closed eyes.
- Trigger alert if sleep or drowsiness is detected.
git clone https://github.com/rahul2002m/Sleep-and-Drowsiness-Detection-using-OpenCV-and-Mediapipe.git
cd Sleep-and-Drowsiness-Detection-using-OpenCV-and-Mediapipe
pip install -r requirements.txt
python drowsy_detection.py
- Driver monitoring systems
- Workplace productivity solutions
- Healthcare and wellness
Pull requests and suggestions are welcome! For major changes, please open an issue first.
For questions connect on LinkedIn.
MIT