Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver Drowsiness Detection using ML #395

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,4 @@ cython_debug/
!/PYTHON APPS/Alarm_Clock/media/image/chose_timer.png

!/PYTHON APPS/Alarm_Clock/media/image/start_alarm.png
.DS_Store
107 changes: 107 additions & 0 deletions MachineLearning Projects/Driver-Drowsiness-Detection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@

# Driver Drowsiness Detection

A system that alarms the driver as soon as it detects that the driver is becoming drowsy to prevent any accidents.



## Quick Start 🚀

### Clone the Repository

```sh
git clone https://github.com/adityajai25/driver-drowsiness-detection.git
```
Then

```sh
cd driver-drowsiness-detection
```


## Dataset

We used a dataset downloaded from Kaggle.
## Creating Virtual Environment

Using a virtual environment isolates dependencies, manages library versions, keeps the global Python environment clean, and ensures consistent setups.

### On Windows

#### Creating a virtual environment:

Open Command Prompt and navigate to the project directory

```sh
cd project/directory/

```
Create a Virtual Environment:
```sh
python -m venv env
```
To Activate the Virtual Environment:

```sh
.\env\Scripts\activate
```

### On mac/Linux

#### Creating a virtual environment:
Open terminal and navigate to the project directory

```sh
cd project/directory/

```
Create a Virtual Environment:
```sh
python -m venv env
```
To Activate the Virtual Environment:

```sh
source env/bin/activate
```


## Installing Required Packages

Once the virtual environment is activated, install the required packages using the following commands:

#### 1. Install pygame

```sh
pip install pygame==2.4.0
```
#### 2. Install openCV-Python

```sh
pip install opencv-python==4.6.0.66
```
#### 3. Install numpy

```sh
pip install numpy==1.23.0
```
#### 4. Install keras

```sh
pip install keras==2.12.0
```
#### 5. Install tensorflow

```sh
pip install tensorflow==2.13.0
```


## Execution
After installing the packages required, the project can be executed using the following command.

```sh
python main.py
```

This will initiate the application, and it may take a few moments to activate the webcam and begin detection.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading