Skip to content

A realtime face detection model to detect people's faces and detect whether they are wearing face masks or not.

License

Notifications You must be signed in to change notification settings

Om4AI/Covid-19-Face-mask-detector

Repository files navigation

Face_mask_detector

During these tough times of COVID 19; face masks have become very important and essential

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.

Check on your own images:

1. Take an image from your Webcam.

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.

Real Time & Flask App prediction results:

These are the predictions for the Flask App & the Real Time Prediction using webcam.

About

A realtime face detection model to detect people's faces and detect whether they are wearing face masks or not.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages