Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.55 KB

README.md

File metadata and controls

39 lines (30 loc) · 1.55 KB

Mask-Detector-DL-OpenCV

Deep Learning based Mask Detector using OpenCV for Python. Convolution Neural Network Model using Keras on Tensorflow.

Prerequisites

  • Python (3.6)
  • Numpy (1.18.4)
  • OpenCV (4.2.0)
  • Keras (2.3.1)
  • Tensorflow (1.14.0)

Dataset

The dataset for the project was courtesy of prajnasb. Consisits of 690 images with mask and 686 images without mask.

Processing

The dataset images were preprocessed into 100x100 grayscale images and data converted into numpy arrays for training neural network.

Model Training

The model was trained with on a 2 Conv Layer CNN architecture with Keras on Tensorflow.

Face Detection

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.

Execute Code

Create folders - savedData and model within project directory

  • processData.py to save numpy array data of images and labels in 'savedData' folder
  • trainModel.py to train your neural network and auto-save model in 'model' folder
  • mainDetect.py to run real time detection

Other Training Methods

  • Using VGGNet as a base model for better accuracy in detection.
  • Training models on PyTorch.

Future Developments

  • 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.