This model is developed with Keras and TensorFlow can be used to detect whether people are wearing a mask or not.
It uses the MobileNetV2 for Transfer Learning and uses the dataset from Kaggle to train the images and correctly classify images as Wearing Mask / Not Wearing Mask. Kaggle dataset link: Kaggle Face-Mask Dataset
Also there is an upload option provided so that we can check how the model performs with the new images from our desktop that we feed it.
2. Run and train the model (I generally use Google Colab).
3. Run the upload cell from the code, it will prompt you to upload a photo from your device; upload the photo which you took in Step 1 & get the results.
4. (Update) Code for Realtime Checking using the model has been included in the repository now. For more reference regarding Saving and Loading Models, view the official documentation: TensorFlow: Load and Save models
5. Real time face mask detection has been included in the repository now. I have used OpenCV (Haarcascades) to take only the face area of the person and feed it to the model that would be a saved H5 file.
Check Face Mask Detector using your own Webcam: Run the Face Mask Detector. Code for a Flask App has also been included to get outputs from a web app in local host.
These are the predictions for the Flask App
& the Real Time Prediction
using webcam.