Skip to content

About

Real-time face mask detection pipeline utilizing TensorFlow, Keras, and OpenCV. Features customized deep learning model training and multi-frame computer vision streams.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Face Mask Detection

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.

                                                                       Python Forks Stargazers


⭐ Features

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

📁 Dataset

The dataset used can be downloaded here - Click to Download

This dataset consists of 5106 images belonging to two classes:

  • with_mask: 3158 images
  • without_mask: 1948 images

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

  • Kaggle datasets
  • Various videos
  • Udemy tutorials

⚠️ Libraries used

⚠️ Haar-cascade used

It is a method applied to find objects on the image. This method is called haar-like features. I used the "haarcascade_frontalface_default.xml" file in this project.

You can download all the haarcascade xml files you need from here.

🚀  Installation

  1. Clone the repo
$ git clone https://github.com/bertuginal/Face-Mask-Detection.git
  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. Type the following command to train the model:
$ python3 Train.py --dataset data
  1. To detect face masks in real-time video streams type the following command:
$ python3 Test.py 

🔑 Results

My model gave 98% accuracy for Face Mask Detection after training via tensorflow-gpu==2.5.0


I got the following accuracy/loss training curve plot.

👇 Images

FRAME: With Mask

I got 98.85% accuracy when wearing a face mask.



FRAME: Without Mask

I got 99.77% accuracy when we were not wearing a face mask.



FRAME: Half With Mask

I got 53.06% accuracy when the face mask is worn under the mouth.


👏 And it's done!

Feel free to mail me for any doubts/query 📧 bertuginal@yahoo.com

⭐ If you like my project, can you click the star to support me?

About

Real-time face mask detection pipeline utilizing TensorFlow, Keras, and OpenCV. Features customized deep learning model training and multi-frame computer vision streams.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages