Skip to content

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

Notifications You must be signed in to change notification settings

amolikvivian/Mask-Detector-DL-OpenCV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages