Giter VIP home page Giter VIP logo

face-mask-detection's Introduction

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

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.

The sharing of the PPT and Project Report costs ₹1000 ($14)

If interested 📧 [email protected]

⌛ Project Demo

🎥 YouTube Demo Link

💻 Dev Link

Already deployed version

⚠️ TechStack/framework used

⭐ Features

Our face mask detector didn't use any morphed masked images dataset. The model is accurate, and since we used the MobileNetV2 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 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: [email protected]

🤝 Contribution

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!

🏆 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

❤️ Owner

Made with ❤️  by Chandrika Deb

👍 Credits

🤝 Our Contributors

CONTRIBUTORS.md

👀 Code of Conduct

You can find our Code of Conduct here.

🙋 Citation

You are allowed to cite any part of the code or our dataset. You can use it in your Research Work or Project. Remember to provide credit to the Maintainer Chandrika Deb by mentioning a link to this repository and her GitHub Profile.

Follow this format:

  • Author's name - Chandrika Deb
  • Date of publication or update in parentheses.
  • Title or description of document.
  • URL.

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

👀 License

MIT © Chandrika Deb

face-mask-detection's People

Contributors

chandrikadeb7 avatar vaishnavi-1 avatar vilsi12 avatar muthuannamalai12 avatar aayush-hub avatar raghavmodi avatar indrapaul824 avatar tanweerulhaque avatar vrushti24 avatar amit366 avatar shubhraagarwal avatar keshav340 avatar sobhit25 avatar spursbyte avatar anirudhsai20 avatar ameyaupalanchi avatar bhendiboi avatar jatinjain001 avatar m-code12 avatar purvanshsingh avatar sahebsunny avatar vinamramunot-tech avatar dependabot[bot] avatar kritikaparmar-programmer avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.