GithubHelp home page GithubHelp logo

tejas-ta / face-mask-detection-real-time-computer-vision Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 170.75 MB

This repository contains code that implemented Mask Detection using MobileNet as the base model and Neural Network as the head model. Code draws a rectangular box over the person's face in red if no mask, green if the mask is on, with 99% accuracy in real-time using a live webcam. Refer to README for demo

Home Page: https://github.com/Tejas-TA/Face-Mask-Detection-Real-Time-Computer-Vision

License: MIT License

Jupyter Notebook 100.00%
computer-vision deep-neural-networks deep-learning keras tensorflow2 mask numpy-arrays opencv matplotlib scipy face-detection mobilenet maxpooling fully-connected-deep-neural-network label-binarizer python3 relu-activation adam-optimizer softmax-layer imagenet

face-mask-detection-real-time-computer-vision's Introduction

Face Mask Detection Real Time / Computer Vision / Object Detection


Detecting whether a person is wearing a mask or not in real-time using Python, Keras, OpenCV, TensorFlow, NumPy, etc. The folder consists of 1900 masked images and unmasked images.

Project Walkthrough -

Data Preprocessing

  1. Created 2 lists – data [] and labels []
  2. In data [], arrays of all the images will be appended and in labels [], arrays of “with_mask” and “without_mask” which is converted using LabelBinarizer from the scikit learn library is appended
  3. All the images are listed using load_img function from Keras library, and then attached corresponding labels to it
  4. The target size is set to 224*224(width and height) so that model is perfect
  5. Using img_to_array from Keras, all the images are converted to arrays.
  6. MobileNet is applied so preprocess_input is used.
  7. Train Test split is done.

Building the network

image

Train the Model -

The below graph summarizes the training image
There is a reduction in loss as the number of epochs increases

Face Detection using Camera (Real-Time)

Using deploy .prototxt and res10_300x300_ssd_iter_140000.caffemodel face is detected and using our deep learning model mask is detected. Please refer to the “Detect Mask Video.ipynb” for the code.


Email - [email protected]
LinkedIn - https://www.linkedin.com/in/tejas-ta/
Blogs - https://tejasta.medium.com/

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.