SmartDriverVision is a real-time driver monitoring system that leverages Computer Vision and Deep Learning to detect drowsiness and distracted driving. Using YOLOv8, MediaPipe Face Mesh, and OpenCV, the system continuously analyzes the driver's facial expressions, eye state, head orientation, and phone usage to estimate a driver risk score and issue real-time alerts.
- ๐๏ธ Real-time Eye Closure Detection
- ๐ด Microsleep Detection
- ๐ฎ Yawn Detection
- ๐ฑ Phone Usage Detection
- ๐งญ Head Pose Estimation
โ ๏ธ Dynamic Driver Risk Score- ๐ Audio Alert System
- ๐ Live Driver Monitoring Dashboard
- ๐ฅ Real-time Webcam Processing
- Python
- OpenCV
- YOLOv8 (Ultralytics)
- MediaPipe Face Mesh
- PyQt5
- NumPy
- Pygame
Webcam
โ
โผ
Frame Capture
โ
โผ
Face Detection (MediaPipe)
โ
โโโโโโโโโโโโโโโ
โผ โผ
Eye Detection Mouth Detection
โ โ
โผ โผ
Microsleep Yawn Detection
Detection
โ
โโโโโโโโโโโโโโโโโ
โผ โผ
Phone Detection Head Pose Estimation
โ โ
โโโโโโโโฌโโโโโโโโ
โผ
Driver Risk Score
โผ
Dashboard + Audio Alerts
The system detects whether both eyes remain closed over consecutive frames to identify prolonged eye closure and microsleep events.
A YOLOv8 model classifies the driver's mouth region to identify yawning behavior and estimate yawn duration.
The system continuously monitors the camera feed to detect mobile phone usage while driving and flags distracted driving events.
MediaPipe facial landmarks are used to estimate head orientation. Significant deviations from the forward direction are considered signs of distraction.
A dynamic driver risk score is computed using multiple behavioral indicators:
- Microsleep duration
- Number of yawns
- Phone usage
- Head orientation
- Eye closure frequency
The score updates continuously during runtime to provide an overall estimate of driver attentiveness.
The PyQt dashboard displays:
- Blink Count
- Microsleep Duration
- Yawn Count
- Yawn Duration
- Phone Detection Status
- Head Pose Status
- Driver Risk Score
- Driver Safety Alerts
SmartDriverVision/
โ
โโโ DrowsinessDetector.py
โโโ requirements.txt
โโโ README.md
โโโ alarm.wav
โโโ yolov8n.pt
โโโ dataset.yaml
โโโ runs/
โ โโโ detecteye/
โ โโโ detectyawn/
โโโ screenshots/
โโโ .gitignore
git clone https://github.com/anvi-tandel/SmartDriverVision.git
cd SmartDriverVisionpython -m venv venvActivate it:
Windows
venv\Scripts\activatemacOS / Linux
source venv/bin/activatepip install -r requirements.txtpython DrowsinessDetector.pyAllow camera access when prompted.
The overall driver risk score combines multiple behavioral indicators.
| Parameter | Contribution |
|---|---|
| Eye Closure | High |
| Microsleep Duration | Very High |
| Yawn Frequency | Medium |
| Phone Usage | High |
| Head Pose Deviation | Medium |
The score updates in real time and helps identify unsafe driving conditions.
- Seatbelt Detection
- Smoking Detection
- Driver Identity Recognition
- Night Vision Support
- Cloud Dashboard
- Driver Performance Analytics
- Multi-Driver Monitoring
- Mobile Application
- Driver Monitoring Systems (DMS)
- Fleet Management
- Smart Transportation
- Automotive Safety
- Logistics & Commercial Vehicles
- Advanced Driver Assistance Systems (ADAS)
Anvi Tandel
B.Tech, IIT (BHU) Varanasi
Interested in Machine Learning, Computer Vision, Data Science, and AI Systems.