Skip to content

Commit ecd4e03

Browse files
authored
Update README.md
1 parent 8a032c7 commit ecd4e03

File tree

1 file changed

+70
-14
lines changed

1 file changed

+70
-14
lines changed

README.md

Lines changed: 70 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,77 @@ This project implements a **Drowsiness Detection System** using **Computer Visio
1010
- **Alert System:** Plays an alarm sound when drowsiness or distraction is detected.
1111
- **Face and Eye Detection:** Utilizes Haar cascades for detecting faces and eyes.
1212

13-
## Prerequisites
1413

15-
Before you begin, ensure that you have met the following requirements:
16-
- Python 3.x (preferably 3.7 or higher)
14+
## Prerequisites
15+
- **Python Version**: Python 3.7 - 3.9 (Python < 3.10 required)
1716
- Webcam for real-time monitoring
18-
- The following dependencies, listed in `requirements.txt` file
17+
- The following dependencies, listed in requirements.txt file
1918

2019
## Setup and Installation
2120

22-
### 1. Create a Virtual Environment
23-
It is recommended to use a virtual environment for dependency management. You can create one using the following command:
21+
### 1. Using Virtual Environment (venv)
2422

23+
#### 1.1 Create Virtual Environment
2524
```bash
2625
python -m venv drowsiness_env
2726
```
2827

29-
### 2. Activate the Virtual Environment
30-
For Windows:
28+
#### 1.2 Activate Virtual Environment
29+
- **Windows**:
30+
```bash
31+
drowsiness_env\Scripts\activate
32+
```
33+
- **macOS/Linux**:
34+
```bash
35+
source drowsiness_env/bin/activate
36+
```
37+
38+
#### 1.3 Install Dependencies
3139
```bash
32-
drowsiness_env\Scripts\activate
40+
pip install -r requirements.txt
41+
pip install protobuf==3.20.0
3342
```
3443

35-
For macOS/Linux:
44+
### 2. Using Conda Environment
45+
46+
#### 2.1 Create Conda Environment
3647
```bash
37-
source drowsiness_env/bin/activate
48+
conda create --name drowsiness_env python=3.9 -y
3849
```
3950

40-
### 3. Install Dependencies
41-
Install the required dependencies from the requirements.txt file:
51+
#### 2.2 Activate Conda Environment
52+
```bash
53+
conda activate drowsiness_env
54+
```
55+
56+
#### 2.3 Install Dependencies
4257
```bash
4358
pip install -r requirements.txt
59+
pip install protobuf==3.20.0
60+
```
61+
62+
### 3. Verify Setup
63+
64+
Check installed packages:
65+
```bash
66+
pip list
4467
```
4568

69+
## Recommendations
70+
71+
- **Conda is recommended** for managing complex dependencies, especially for machine learning projects with potential GPU support.
72+
- Always ensure you're in the correct virtual environment before running the project.
73+
- Keep your `requirements.txt` updated with all necessary dependencies.
74+
75+
## Troubleshooting
76+
77+
- If you encounter any installation issues, ensure you have the latest version of pip:
78+
```bash
79+
pip install --upgrade pip
80+
```
81+
- Check Python version compatibility (Python 3.7 - 3.9 recommended)
82+
- Verify all system dependencies are installed
83+
4684
Required libraries include:
4785
```text
4886
opencv-python
@@ -94,6 +132,24 @@ To exit the program, press `q` in the terminal or stop the script execution.
94132
- **Webcam not detected**: Ensure that your webcam is properly connected and accessible by other applications. Try restarting your machine if the issue persists.
95133
- **Model loading errors**: If you get an error related to loading the model (`cnnfinal.h5`), make sure the file is placed in the correct directory and the path is specified correctly in the script.
96134

135+
## Reporting Issues and Contributing
136+
137+
### Reporting Errors or Bugs
138+
139+
1. **Check Existing Issues**
140+
- Before reporting, search existing GitHub issues to avoid duplicates.
141+
142+
2. **Create a Detailed Bug Report**
143+
- Use GitHub Issues
144+
- Include:
145+
- Detailed description of the error
146+
- Steps to reproduce
147+
- Your environment details (OS, Python version, etc.)
148+
- Full error traceback
149+
150+
151+
- Discuss in project discussions/comments
152+
97153
## Contributing
98154

99155
We welcome contributions to this project! If you'd like to contribute, please follow these steps:
@@ -111,4 +167,4 @@ This project is licensed under the MIT License - see the LICENSE file for detail
111167

112168
- **OpenCV**: For providing the face and eye detection algorithms.
113169
- **MediaPipe**: For real-time gaze and head pose tracking.
114-
- **Keras**: For providing the deep learning framework used to train the eye state classification model.
170+
- **Keras**: For providing the deep learning framework used to train the eye state classification model.

0 commit comments

Comments
 (0)