A real-time driver monitoring system designed to enhance road safety by detecting fatigue and yawning through computer vision and facial landmark analysis. This system uses Mediapipe and OpenCV to process live webcam feeds and trigger audio alerts when unsafe behaviors are detected.
- Fatigue Detection: Monitors eye closure over time using the Eye Aspect Ratio (EAR).
- Yawn Detection: Identifies excessive mouth opening using the Mouth Aspect Ratio (MAR).
- Real-Time Alerts: Plays an alert sound when signs of fatigue or yawning are detected.
- Lightweight and Efficient: Runs seamlessly on standard webcams with minimal system requirements.
- Programming Language: Python
- Libraries:
- Hardware: Standard webcam or equivalent video capture device.
- Python 3.7 or later
- A functional webcam
- Clone the repository:
git clone https://github.com/TanishqP07/Driver-Behavior-Safety-System.git cd Driver-Behavior-Safety-System
- Install Dependencies Install the required Python libraries using:
pip install -r requirements.txt
- Run the Application Start the program with:
python main.py
- Optional: Modify the alert sound in the script by replacing alert.mp3 with your own audio file in the corresponding line:
pygame.mixer.music.load(r"C:\path\to\your\alert.mp3")
- Ensure your webcam is connected and functional.
- Run the
main.py
script. - The system will:
- Monitor your eyes and mouth in real time.
- Display EAR and MAR values on the screen.
- Trigger an audio alert if:
- Fatigue is detected (prolonged eye closure).
- Yawning is detected (excessive mouth opening).
- Press
q
to exit the application.
- Integration with IoT devices for vehicle-based alerts.
- Improved accuracy using advanced deep learning models.
- Cloud-based logging for long-term behavior analysis.
- Multi-language support for alerts.
Contributions are welcome! Here's how you can help:
- Fork the repository.
- Create a new branch for your changes.
- Submit a pull request for review.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions, suggestions, or a collaboration, feel free to reach out:
- Email: [email protected]
- GitHub: TanishqP07