Coder Social home page Coder Social logo

vitorrlopes / mask-detector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fnandocontreras/mask-detector

0.0 0.0 0.0 8.46 MB

During Covid19 quarantine i decided to implement my own version of face mask detector using Deep Learning models just for fun.

Python 0.68% Jupyter Notebook 99.32%

mask-detector's Introduction

mask-detector

During Covid19 quarantine i decided to implement my own version of face mask detector using OpenCV, Keras and Tensorflow Deep Learning models just for fun.

Alt text

Checkout the code:

git clone https://github.com/fnandocontreras/mask-detector.git

Install Requirements

To be able to run the code, before you need to install the required packages:

To install using anaconda run the following commands:

conda env create -f environment.yml
conda activate maskdetector

The file "environment.yml" contains the required packages for running mask-detector and after running the commands above, anaconda will create a virtual environment name "maskdetector" with all the requirements specified in the env file. If you don't have anaconda you can install the required packages by hand using PIP:

pip install numpy tensorflow keras mtcnn pillow opencv

After installation you are ready to run the mask detector program

Running the mask detector

For running the mask detector using your webcam live streaming run the following command:

python app.py

For running the mask detector on a video file run the following command:

python app.py --source <your-video-filename>

For some videos made with a smartphone you can experience that the image is rotated 90 degrees, this is because the mask detector is not checking orientation. To fix this you can pass the argument: "rotate" like:

python app.py --source <your-video-filename> --rotate

Recording

You can also record the video streaming by passing the argument "--rec" like:

python app.py --rec

It will record the video streaming in a video file named: "record.avi"

Training the classification model

If you are curious to see how i trained the model using tensorflow and keras you can see the notebook: training_model.ipynb

mask-detector's People

Contributors

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