Deep Learning based Mask Detector using OpenCV for Python. Convolution Neural Network Model using Keras on Tensorflow.
- Python (3.6)
- Numpy (1.18.4)
- OpenCV (4.2.0)
- Keras (2.3.1)
- Tensorflow (1.14.0)
The dataset for the project was courtesy of prajnasb. Consisits of 690 images with mask and 686 images without mask.
The dataset images were preprocessed into 100x100 grayscale images and data converted into numpy arrays for training neural network.
The model was trained with on a 2 Conv Layer CNN architecture with Keras on Tensorflow.
Region of Interest - face, in this case, was isolated using Haar Cascade Classifiers. A primitive method to detect faces from given frame and then passing it through trained model for predictions.
Create folders - savedData
and model
within project directory
processData.py
to save numpy array data of images and labels in 'savedData' foldertrainModel.py
to train your neural network and auto-save model in 'model' foldermainDetect.py
to run real time detection
- Using VGGNet as a base model for better accuracy in detection.
- Training models on PyTorch.
- The next commit will use Caffe as a pretrained model to detect faces. A deep learning approach to isolate and grab ROI from the frame.
- Using YOLO with darknet to perform face detection.