KingK619 / Facemask-Detection

Maskd (Face Mask Detection system) built with OpenCV, Keras/TensorFlow using Deep Learning and Computer Vision concepts in order to detect face masks in static images as well as in real-time video streams.

Home Page:https://bit.ly/34M7H4M

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Face Mask Detection

Maskd (Face Mask Detection system) built with OpenCV, Keras/TensorFlow using Deep Learning and Computer Vision concepts in order to detect face masks in static images as well as in real-time video streams.

                                   

Made withJupyter

Python contributions welcome Website monip.org GitHub license

                                                                                                                                            Live Demo

๐Ÿ’ช Motivation

In the present scenario due to Covid-19, there is no efficient face mask detection applications which are now in high demand for transportation means, densely populated areas, residential districts, large-scale manufacturers and other enterprises to ensure safety. Also, the absence of large datasets of โ€˜with_maskโ€™ images has made this task more cumbersome and challenging.

๐Ÿ’ป Live Demo

Open in Streamlit

โš ๏ธ TechStack/framework used

โญ Usecase

Our face mask detector didn't use any morphed masked images dataset. The model is accurate, and since we used the CNN architecture, itโ€™s also computationally efficient and thus making it easier to deploy the model to embedded systems (Raspberry Pi, Google Coral, etc.).

This system can therefore be used in real-time applications which require face-mask detection for safety purposes due to the outbreak of Covid-19. This project can be integrated with embedded systems for application in airports, railway stations, offices, schools, and public places to ensure that public safety guidelines are followed.

๐Ÿ“ Dataset

The dataset used can be downloaded here - Click to Download

This dataset consists of 4000 images belonging to two classes:

  • with_mask: 2000 images
  • without_mask: 2000 images

The images used were real images of faces wearing masks. The images were collected from the following sources:

โš™๏ธ Prerequisites

All the dependencies and required libraries are included in the file requirements.txt See here

๐Ÿš€  Installation

  1. Clone the repo
$ git clone https://github.com/KingK619/Facemask-Detection.git
  1. Change your directory to the cloned repo
$ cd Face-Mask-Detection
  1. Create a Python virtual environment named 'test' and activate it
$ virtualenv test
$ source test/bin/activate
  1. Now, run the following command in your Terminal/Command Prompt to install the libraries required
$ pip3 install -r requirements.txt

๐Ÿ’ก Working

  1. Open terminal. Go into the cloned project directory and type the following command:
$ python3 train_mask_detector.py --dataset dataset
  1. To detect face masks in an image type the following command:
$ python3 detect_mask_image.py --image images/pic1.jpeg
  1. To detect face masks in real-time video streams type the following command:
$ python3 detect_mask_video.py 

๐Ÿ† Results

Our model gave around 99% accuracy for Face Mask Detection after training.

We got the following accuracy/loss training curve plots

Streamlit app

Face Mask Detector webapp using Tensorflow & Streamlit command

$ streamlit run deploy.py 

๐Ÿค Contribution

Feel free to file a new issue with a respective title and description on the the Facemask_Detection repository. If you already found a solution to your problem, We would love to review your pull request!

๐Ÿค Contributors

Karanveer Sidana

Hiten Goyal

Charanjeet Singh

About

Maskd (Face Mask Detection system) built with OpenCV, Keras/TensorFlow using Deep Learning and Computer Vision concepts in order to detect face masks in static images as well as in real-time video streams.

https://bit.ly/34M7H4M


Languages

Language:Jupyter Notebook 99.4%Language:Python 0.6%