The AntiDrowsySystem is an advanced Python-based system that uses OpenCV, AI, and Machine Learning to detect drowsiness by monitoring facial features like eyes and mouth. It uses pre-trained Haar cascade classifiers for detecting faces, eyes, and mouth, as well as a machine learning model to predict if the user is drowsy.
The system provides real-time monitoring and alerts to prevent drowsiness while driving or during other critical activities. The project uses a user-friendly GUI for easy interaction.
- Real-Time Face Detection: Utilizes Haar cascade classifiers to detect faces, eyes, and mouth. 👁️👄
- Drowsiness Detection: AI-based model to analyze eye and mouth states for detecting drowsiness. 🧠
- Alert System: Sounds an alarm or provides visual cues when drowsiness is detected. 🚨
- Graphical User Interface (GUI): Simple, intuitive interface for interaction. 🖥️
- Cross-Platform: Developed using Python, works on both Windows and Linux systems. 🖥️🔄
- Python 🐍
- OpenCV 📸
- Classifiers 🔍
- Machine Learning 🤖
- GUI Framework (for visualization and interaction) 🖥️
-
Clone the repository:
git clone https://github.com/anmol8070/AntiDrowsySystem.git
-
Install the required libraries:
pip install opencv-python pip install opencv pip install numpy pip install scikit-learn
-
Download the Haar cascade files and place them in the
haar cascade files/
directory:haarcascade_frontalface_alt.xml
haarcascade_lefteye_2splits.xml
haarcascade_righteye_2splits.xml
haarcascade_mcs_mouth.xml
-
Ensure the
model.pkl
file is placed in the root directory of the project.
-
Run the Python script:
python AntiDrowsySystem.py
-
The GUI will open, and the system will start detecting your face, eyes, and mouth.
-
If the system detects drowsiness based on your facial features, an alert will be triggered. 🚨
AntiDrowsySystem.py
: Main Python script to run the system. Contains the logic for face, eye, and mouth detection, as well as drowsiness detection. 🔍model.pkl
: Machine learning model for predicting drowsiness. 🤖haar cascade files/
: Folder containing Haar cascade XML files for face, eye, and mouth detection. 🔐
Feel free to fork the repository and contribute by opening issues or pull requests. Contributions are always welcome! 🎉
This project is licensed under the MIT License - see the LICENSE file for details. 📝
- OpenCV for computer vision tasks. 👁️
- The developers and researchers behind machine learning models used in drowsiness detection. 🤖
- The community for providing Haar cascade files for object detection. 🔬