Real time face-mask detection using Deep Learning and OpenCV
This project uses a Deep Neural Network, more specifically a Convolutional Neural Network, to differentiate between images of people with and without masks. The CNN manages to get an accuracy of 98.37% on the training set and 96.8% on the test set. Then the stored weights of this CNN are used to classify as mask or no mask, in real time, using OpenCV. With the webcam capturing the video, the frames are preprocessed and and fed to the model to accomplish this task. The model works efficiently with no apparent lag time between wearing/removing mask and display of prediction.
The data used can be downloaded through this link or can be downloaded from this repository as well (folders 'test' and 'train'). There are 3725 images with mask and 3828 images without mask.
To use this project on your system, follow these steps:
1.Clone this repository onto your system by typing the following command on your Command Prompt:
git clone https://github.com/MuntahaShams/real-time-mask-detection.git
followed by:
cd real-time-mask-detection
- Open jupyter notebook using cmd
jupyter notebook
- Go to realtime.ipnyb:
run all cells