Detecting whether a person is wearing a mask or not in real-time using Python, Keras, OpenCV, TensorFlow, NumPy, etc. The folder consists of 1900 masked images and unmasked images.
- Created 2 lists – data [] and labels []
- In data [], arrays of all the images will be appended and in labels [], arrays of “with_mask” and “without_mask” which is converted using LabelBinarizer from the scikit learn library is appended
- All the images are listed using load_img function from Keras library, and then attached corresponding labels to it
- The target size is set to 224*224(width and height) so that model is perfect
- Using img_to_array from Keras, all the images are converted to arrays.
- MobileNet is applied so preprocess_input is used.
- Train Test split is done.
The below graph summarizes the training
There is a reduction in loss as the number of epochs increases
Using deploy .prototxt and res10_300x300_ssd_iter_140000.caffemodel face is detected and using our deep learning model mask is detected. Please refer to the “Detect Mask Video.ipynb” for the code.
Email - [email protected]
LinkedIn - https://www.linkedin.com/in/tejas-ta/
Blogs - https://tejasta.medium.com/