Mask Detection using OpenCV
The aim is to create a deep learning model using Keras and Tensorflow to detect whether a person is wearing a face mask or not. Wearing masks and social distancing are two most important precautions to take.
I have used OpenCV to take a video as input and return a set of images that detect whether an individual is wearing a mask or not. This will be further updated to achieve a higher accuracy.
The CNN Model built is explained with the help of a flow diagram, as shown below.
The dataset used in this project can be found here.
- python
- tensorflow
- keras
- OpenCV
- numpy
- matplotlib
- Run the jupyter notebook as is.
- In the last step of the notebook we save our CNN Model as 'model.h5'. Download this model and save it in the same directory as all the other files.
- Create an empty folder named 'input'. The frames will be extracted from the video stream and saved in this folder. Each of these images will then be analysed separately.
- Run 'mask.py'