Skip to content

Real-time driver behavior monitoring system using facial landmark detection to prevent accidents caused by fatigue or distraction.

License

Notifications You must be signed in to change notification settings

TanishqP07/Driver-Behavior-Safety-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚗 Driver Behavior Safety System

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.


🌟 Features

  • 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.

🛠️ Technologies Used

  • Programming Language: Python
  • Libraries:
    • Mediapipe for facial landmark detection.
    • OpenCV for real-time video processing.
    • Pygame for audio alerts.
  • Hardware: Standard webcam or equivalent video capture device.

📦 Installation

Prerequisites

  • Python 3.7 or later
  • A functional webcam

Steps to Set Up

  • 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")
    

📋 Usage

  1. Ensure your webcam is connected and functional.
  2. Run the main.py script.
  3. 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).
  4. Press q to exit the application.

🚀 Future Enhancements

  • 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.

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Submit a pull request for review.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


📫 Contact

For any questions, suggestions, or a collaboration, feel free to reach out:

About

Real-time driver behavior monitoring system using facial landmark detection to prevent accidents caused by fatigue or distraction.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages