/IIITD_ALIVE_DSM

Submission for IIITD's ALIVE project round 2.

Primary LanguageJupyter Notebook

IIITD ALIVE DSM submission

Python application Open In Colab

Submission for IIITD's ALIVE project round 2.

Overview

Relevant files

Dataset

The model uses a combination of 2 datasets to improve the accuracy. These datasets are -

The total number of images used -

  • 2726 open eye images
  • 2726 closed eye images

Usage

  1. Clone this repository.
git clone https://github.com/Saransh-cpp/IIITD_ALIVE_DSM
  1. Create a virtual environment
cd IIITD_ALIVE_DSM
python -m venv .env
  1. Activate the environment
.env/Scripts/activate
  1. Install the requirements
pip install -r requirements.txt
  1. Run train.ipynb to re-train the model (the model is already trained).
  2. To start the live video feed for drowsiness detection, run -
python drowsiness_detector.py

Note: You might need to edit thhe number passed in VideoCapture to your webcam's number (0, 1, 2, 3, ....) -

cap = cv2.VideoCapture(3)

  1. To stop the live feed press q.

Model architecture

  • The training step uses Transfer Learning with VGG19.
  • Last layer of VGG19 has been removed and a Flatten layer with a new output layer has been added.
  • The model uses adam optimizer and categorical_crossentropy loss function.

The train notebook is very well documented.

Drowsiness setector in action (screenrecording)

2022-01-11.23-17-22.mp4

Extras

The repository contains a CI built using GitHub Action which can be scaled up to include testing of the scripts.

Tasks

Task 1

The model has been trained and converted into tflite format in the train notebook. The trained tflite model is also present here.

Task 2

Drowsiness detector to run on live video feed has been created in drowsiness_detector.py.