🚗 Drive Aware Detection System
This project is an AI-powered driver monitoring system that detects drowsiness and dangerous emotions (anger, fear, sadness) in real time using a webcam. It combines MediaPipe FaceMesh and DeepFace for facial and emotional analysis, alerting drivers through sound warnings when unsafe conditions are detected.
⚙️ Features
👀 Drowsiness Detection: Uses Eye Aspect Ratio (EAR) to detect closed eyes or sleeping.
😠 Emotion Detection: Analyzes emotions and triggers alerts for anger, fear, or sadness.
🧍 Head Tracking: Alerts when driver’s face leaves the frame.
🔊 Audio Alerts: Plays alarm sound during drowsiness or emotional distress.
📊 On-Screen Status: Shows EAR, blink count, drowsy events, and emotional stability.
🧩 Requirements
Python 3.10
Install dependencies:
pip install opencv-python cvzone deepface pygame numpy mediapipe==0.10.0
Place nuclear-alarm-104598.mp3 in the same folder as test.py.
Press q to quit.
🧠 System Indicators
Status Meaning
✅ Stable Normal emotion and alertness
Works best in good lighting with a visible face.
Requires a functioning webcam and microphone.
Adjustable parameters:
alert_threshold (default 0.6)
sleep_duration (default 3.0s)