Skip to content

A python tool to detect if a person is wearing a mask or not in real-time using deep learning techniques. It works with images, videos, and real-time videos as well.

Notifications You must be signed in to change notification settings

snehitvaddi/FaceMask-Detection-using-Deeplearning

Repository files navigation

😷 FaceMask-Detection-using-Deeplearning

A CNN based Image Classification model to classify people with and without masks. A pilot project of Face mask detection. During the times of COVID-19, covering our face with a mask and maintaining social distancing is essential.
With advancements in the field of Deep Learning, now we can easily train a model and check if someone is earning a mask or not.

I have made FaceMask Detection.ipynb private to avoid misuse, contact me @[email protected] for complete directory ☺
Need a detailed explanation of the project? ping me for personal 1-1 explanation ☝

🗃 Dataset 📰 HaarCascade
Link File

📢 Favour:

It would be highly motivating, if you can STAR⭐ this repo if you find it helpful.😅

🎉 Output:

🏃‍♂️ How to Run

Detecting faces with maks in video

  1. Navigate to jupyter-notebook ./FaceMask Detection using Deep Learning.ipynb
    I made this file private to avoid misuse, contact me @[email protected] for complete directory ☺
  2. Run import libraries cell and load model cell.
  3. For getting real-time results, run predicition and casscade classifier cell

🧠 How it works!!

  • Read input either as single image or video from webcam using OpenCV.
  • Detect location of faces in given frame using Face_Frontal_Default Cascade Classifier.Download
  • Save the list of face portions for further steps.
  • Load the Custom-trained CNN model, iterate each face through the model to predict mask on face.
  • Post-process the frame ie; Tagging Face, with respective predictions.

🔧Setup

You can setup this project using either of the methods mentioned below.

👉 Method 1: Setup (Pipenv Virtual Environment)

  1. Clone the project to your local system
  2. Navigate inside the project directory on your local system inside the terminal
  3. Install all dependencies using pipenv install --ignore-pipfile
  4. Start environment with pipenv shell

👉 Method 2: Setup (pip)

  1. Clone the project to your local system
  2. Navigate inside the project directory on your local system inside the terminal
  3. Install all dependencies using pip install -r requirements.txt

👁‍ Creator Disclaimer Since the dataset used here is Open-Sourced, this code should only be used for research/academic/personal purposes only. The models were trained on the prajnasb's Open Source dataset, any form of commercial use is strictly prohibhited. Please contact me for all further queries.😉

About

A python tool to detect if a person is wearing a mask or not in real-time using deep learning techniques. It works with images, videos, and real-time videos as well.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published