An image processing CNN model in python to tell if an image has a face with a mask or not.
Feel Free to use my Dataset:: https://drive.google.com/drive/folders/1xGi1P11vAZPx_d0j_BfBQCqaUEBVRxPP?usp=sharing
Please keep all the contents of the repository and the downloaded dataset in the same folder for proper functioning. Cheers!
Before executing the python notebook be sure to install keras and numpy. For installing first check if you have python installed.
Head over to python.org
to install python. When installed run command prompt. Execute the command pip install keras
and then pip install numpy
.
These codes will successfully install keras and numpy modules in your system.
The python notebook is commented in each block to make it easier to understand.
The code Follows the following approach::
1) importing all the required modules
2) Initialising the CNN
3) Step 1 - Convolution
4) Step 2 - Pooling
5) adding another convolution layer to improve the accuracy
6) Step 3 - Flattening
7) Step 4 - Full connection
8) Compiling the CNN
9) fit CNN to images
10) the training set
11) the test set
12) predictions for face without mask using train model
13) predictions for face with mask image using train model