• Stars
    star
    1,530
  • Rank 30,597 (Top 0.7 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Face Mask Detection system based on computer vision and deep learning using OpenCV and Tensorflow/Keras

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 contributions welcome Forks Stargazers Issues LinkedIn

                                    Live Demo

👇 Support me here!

Buy Me A Coffee

😇 Motivation

Amid the ongoing COVID-19 pandemic, there are 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. The absence of large datasets of ‘with_mask’ images has made this task cumbersome and challenging.

PPT and Project Report sharing costs ₹1000 ($15)

If interested, contact me at [email protected]

🌟 Purchase on Gumroad

⌛ Project Demo

🎥 YouTube Demo Link

💻 Dev Link

Already deployed version

⚠️ TechStack/framework used

⭐ Features

Our face mask detector doesn't use any morphed masked images dataset and the model is accurate. Owing to the use of MobileNetV2 architecture, it is computationally efficient, 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 4095 images belonging to two classes:

  • with_mask: 2165 images
  • without_mask: 1930 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/chandrikadeb7/Face-Mask-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 98% accuracy for Face Mask Detection after training via tensorflow-gpu==2.5.0

Open In Colab

We got the following accuracy/loss training curve plot

Streamlit app

Face Mask Detector webapp using Tensorflow & Streamlit

command

$ streamlit run app.py 

Images

Upload Images

Results

👏 And it's done!

Feel free to mail me for any doubts/query 📧 [email protected]


Internet of Things Device Setup

Expected Hardware

Getting Started

Raspberry Pi App Installation & Execution

Run these commands after cloning the project

Commands Time to completion
sudo apt install -y libatlas-base-dev liblapacke-dev gfortran 1min
sudo apt install -y libhdf5-dev libhdf5-103 1min
pip3 install -r requirements.txt 1-3 mins
wget "https://raw.githubusercontent.com/PINTO0309/Tensorflow-bin/master/tensorflow-2.4.0-cp37-none-linux_armv7l_download.sh" less than 10 secs
./tensorflow-2.4.0-cp37-none-linux_armv7l_download.sh less than 10 secs
pip3 install tensorflow-2.4.0-cp37-none-linux_armv7l.whl 1-3 mins

🏆 Awards

Awarded Runners Up position in Amdocs Innovation India ICE Project Fair

🙋 Cited by:

  1. https://osf.io/preprints/3gph4/
  2. https://link.springer.com/chapter/10.1007/978-981-33-4673-4_49
  3. https://ieeexplore.ieee.org/abstract/document/9312083/
  4. https://link.springer.com/chapter/10.1007/978-981-33-4673-4_48
  5. https://www.researchgate.net/profile/Akhyar_Ahmed/publication/344173985_Face_Mask_Detector/links/5f58c00ea6fdcc9879d8e6f7/Face-Mask-Detector.pdf

👏 Appreciation

Selected in Devscript Winter Of Code

Selected in Script Winter Of Code

Seleted in Student Code-in

👍 Credits

🤝 Contribution

Please read the Contribution Guidelines here

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

🤝 Our Contributors

👀 Code of Conduct

You can find our Code of Conduct here.

❤️ Owner

Made with ❤️  by Chandrika Deb

👀 License

MIT © Chandrika Deb

More Repositories

1

chandrikadeb7.github.io

Personal portfolio website hosted using GitHub Pages - Version 2
JavaScript
229
star
2

Hacktoberfest_2021

This repository aims to help code beginners with their first successful pull request and open source contribution. Happy coding!
HTML
113
star
3

JPMorgan-Chase-Virtual-Internship

This repository contains the submitted patch files of the various tasks assigned by JPMorgan Chase & Co. Software Engineering Virtual Internship
Python
64
star
4

chandrikadeb7

39
star
5

Coursera_IBM_Data_Science_Professional_Certificate

This repo consists of the lecture PDFs and quiz solutions of all the courses under the IBM Data Science Professional Certificate specialization course of Coursera.
Jupyter Notebook
35
star
6

100DaysOfCode

Repository dedicated to my #100DaysOfCode journey
33
star
7

chandrikadeb7.github.io-v1

Portfolio Website using GitHub Pages. You can visit the website here:
HTML
28
star
8

Face-Recognition-in-Python

A real time face recognition system developed in Python using Pillow, OpenCV and NumPy
Jupyter Notebook
27
star
9

Girlscript-Twitter-Bot

Twitter bot in Python for Girlscript Foundation
Python
27
star
10

kubernetes-handbook

This handbook covers a beginner-friendly detailed understanding of Kubernetes core concepts.
26
star
11

learning-easy-golang

Collection of small code gists along my Golang learning journey
Go
16
star
12

Social-Media-Launcher-Chrome-Extension

Simple Chrome Extension for a quick launcher to your all social media profiles at one click.
HTML
15
star
13

StudentManagementSystem

Java Swing based project with MySQL database developed using Netbeans IDE
Java
9
star
14

Awesome-LeetCode-Python

Python solutions submitted in Leetcode challenges
Python
7
star
15

IntelliJ-Idea-Tips-n-Tricks

6
star
16

MyOnlineStore

My first PHP project on eCommerce website development.
PHP
6
star
17

Bengali-Blog-Moner-Hoichoi

Template repository for Bengali Blog
CSS
6
star
18

IBM-Cognitiveclass-Python_for_Data_Science

Cognitiveclass.ai - PY0101EN Python for Data Science
HTML
6
star
19

Google-Foobar-Challenge

My submitted solutions in Google Foobar Challenge in Python language
Python
5
star
20

go-couchbase-microservice

Go Microservice developed using Go Echo API Server OpenAPI with Couchbase backend
Go
5
star
21

FreeCodeCamp-Projects

Submitted solutions for Scientific Computing with Python course
Python
4
star
22

Edureka-Java-Assignment

Collection of Java source codes submitted as part of Edureka's Amdocs Course
Java
4
star
23

LinkedIn-SDE-CodingSolutions

This repo consists of coding solutions submitted as part of LinkedIn SDE Role hiring process.
Java
4
star
24

TicTacToe

A simple Tic-Tac-Toe game developed using Python using random and sys Python modules
Python
4
star
25

Random-ProjectIdeaGenerator

Kotlin based Android project which generates project ideas randomly built for #30DaysOfKotlin program
Kotlin
4
star
26

Covid-19-HelpDesk

Covid-19 helpdesk for tracking moderate and high risk patients around us along with online doctor portal.
JavaScript
4
star
27

IBM_CognitiveClass.ai_How-to-Build-Chatbots

CB0103EN course on IBM CognitiveClass.ai. All lecture videos and quiz solutions are provided for this course in this repo.
4
star
28

chandrikadeb7.github.io-demo

SCSS
3
star
29

FDI_Analysis_Python

Jupyter Notebook
3
star
30

chandrikadeb7.github.io-ex

CSS
3
star
31

LeetCode-Solutions

Repo for accepted solutions in LeetCode in Java language with all difficulty levels
Java
3
star
32

Cowin-Telegram-Bot

Telegram bot source code to check the available vaccine slots via states, districts, or Pincode
Python
2
star
33

sentence-rephrase

TypeScript
2
star
34

Coursera_Machine_Learning

programming assignment solutions of Coursera Machine Learning course by Stanford University
MATLAB
2
star
35

HackerRank-Python

Python practice problems submissions done by me on Hackerrank
Python
1
star
36

May-Leetcoding-Challenge

May Leetcoding challenge submissions repository
Python
1
star
37

Telecom-Customer-Churn-EDA

Exploratory Data Analysis of Telecom Customer Churn Kaggle dataset
Jupyter Notebook
1
star
38

aviyel-weather-chatbot

Chatwoot demo on weather website deployed on Netlify
JavaScript
1
star
39

Topsis_Python

Python
1
star