Giter Site home page Giter Site logo

face_mask_detection's Introduction

About The Project

During the pandemic COVID-19, the World Health Organization (WHO) advised the use of masks as part of a comprehensive package of prevention and control measures to limit the spread of this virus.This project is focused on Real time face mask detection algorithm using machine learning with Python.

Libraries used

  • Tensorflow
  • Keras
  • OpenCV
  • numpy

Setup

To run this project, install the libraries locally using pip:

pip install tensorflow
pip install numpy
pip install matplotlib
pip install opencv

Summary of code

The project can be divided into three parts:

1. Reshaping and Normalizing images in dataset.

Here we are customizing our dataset to make it perfect for our model. The images are resized and augmented using imagedatagenerator and stored separately for train and validation.

2. Creation and training of model using tensorflow.

Now after creating sets for training and validation next step is to build the model.The model is built using convolutional neural networks(CNN), Maxpooling layers and Dense layers along with activation functions Relu and sigmoid.

After model is created it needs to be compiled.For compilation the loss function used is categorical crossentropy,optimizer used is Adam.

Now its time to train our model with the images in train set. The model is trained with train set, validation set and checkpoints to save after completing 100 steps in each epoch.Once the training is complete the model is saved in .h5 format.

3. Using trained model in opencv to detect face-mask.

Using opencv we can take input image through our webcam. Using cascade classifiers in opencv we can fetch the face area and use our trained model to predict whether the person is wearing face-mask or not.

Testing the model in Real-time

...

...

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement" or "feature". Don't forget to give the project a star!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

face_mask_detection's People

Contributors

sourabhere avatar

Stargazers

Kartik Tanwar avatar Arjyo Chakraborty avatar

Watchers

 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.