demo_short.mp4
A real-time Computer Vision system that detects driver fatigue using Eye Aspect Ratio (EAR) and Head Pose Estimation. Built as a reproduction and modernization of the Red Hen Lab GSoC 2016 Audio-Visual module.
- Real-time Eye Tracking: Uses dlib's 68-point facial landmark predictor.
- Blink Detection: Calculates Eye Aspect Ratio (EAR) to detect prolonged eye closure.
- Head Pose Estimation: Tracks face orientation (yaw/pitch/roll) using PNP algorithms.
- Dual Alarm System:
- Visual: "WAKE UP!" warning overlay.
- Audio: System beep alert for immediate driver correction.
- Language: Python 3.x
- Vision: OpenCV (
cv2), Dlib - Math: NumPy, SciPy
-
Clone the repository:
git clone [https://github.com/dramer-B/Driver-Drowsiness-AI.git](https://github.com/dramer-B/Driver-Drowsiness-AI.git) cd Driver-Drowsiness-AI -
Install dependencies:
pip install opencv-python numpy scipy dlib
-
Run the Engine:
- For Webcam:
python3 ignite.py
- For Video File:
Edit
ignite.pyto point to your.mp4file.
- For Webcam:
The system uses the Eye Aspect Ratio formula derived from Soukupová and Čech (2016):
EAR = (||p2 - p6|| + ||p3 - p5||) / (2 * ||p1 - p4||)
If the EAR falls below 0.25 for a set duration, the alarm triggers.
