Coder Social home page Coder Social logo

parvvaresh / face-mask Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 0.0 2 KB

The Face Mask Detection script is a real-time application that utilizes deep learning techniques to identify whether a person in a webcam feed is wearing a face mask or not.

Python 100.00%
computer-vision covid-19 cv2-library python tensorflow

face-mask's Introduction

Face Mask Detection using TensorFlow and OpenCV

This is a Python script for real-time face mask detection using a pre-trained MobileNetV2 model with TensorFlow and OpenCV. It can process live video from a webcam and classify faces as wearing a mask or not wearing a mask.

Requirements

Before running the code, make sure you have the following dependencies installed:

  • TensorFlow
  • OpenCV
  • imutils
  • NumPy

You can install these dependencies using pip:

pip install tensorflow opencv-python imutils numpy

Usage

  1. Clone the repository or download the code files to your local machine.

  2. Download the pre-trained face detection model and save it in the face_detector directory. You can get the model files from the OpenCV GitHub repository:

  3. Download the pre-trained face mask detection model (mask_detector.model) and place it in the same directory as the script.

  4. Run the script:

python face_mask_detection.py
  1. A window will open, showing the webcam feed with face mask predictions. Press 'q' to quit the application.

How It Works

  • The script uses the MobileNetV2 model for face mask detection. It first detects faces in each frame using the pre-trained face detection model.

  • If a face is detected, it extracts the face region, pre-processes it, and passes it through the face mask detection model to classify whether the person is wearing a mask or not.

  • The result is displayed on the video feed, with bounding boxes and labels.

License

This project is licensed under the MIT License.

face-mask's People

Contributors

parvvaresh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.