Originally created for the Vancouver School of AI Image Classification Workshop Code Challenge.
The Distraction Detector works as follows:
-
Uses the default OpenCV Haar Cascade Face Detector to detect a person's face.
-
Within a detected face, the person's eyes are located using the OpenCV Haar Cascade Eye Detector.
-
For each detected eye, a pretrained Convolutional Neural Network(CNN) is used to predict whether a person is distracted or not(binary classifier). The default CNN was trained on eye images created by the
get_data.py
script (which essentially saves detected eyes as individual images).
Below table contains all the important scripts in this repo.
File | Description |
---|---|
get_data.py |
Creates training data for Distraction Classifier |
train.py |
Creates and trains Distraction Classifier using Keras |
distraction_detector.py |
Detects distraction using OpenCV and Keras |