Real-time driver drowsiness detection using MediaPipe FaceLandmarker and Eye Aspect Ratio (EAR).
- Python 3.10
- OpenCV
- MediaPipe (Tasks API)
- NumPy
- SciPy
- Face detection using MediaPipe FaceLandmarker (478 landmarks)
- Eye landmark extraction
- Eye Aspect Ratio (EAR) calculation
- Temporal smoothing using consecutive frame threshold
- Real-time alert generation when drowsiness detected
- Webcam captures live video
- FaceLandmarker detects 478 facial landmarks
- Eye landmarks extracted
- EAR computed
- If EAR < threshold for consecutive frames → alert triggered
python app.py