Giter VIP home page Giter VIP logo

facemask-recognition's Introduction

Facemask Detection

Requirements

pip install -r requirements.txt

Download our trained models

Download the files and put them in a folder named models: Leo Google Drive

Single Person Classification

Dataset

For training, we used the following dataset from Kaggle Mask Datasets V1. Put the files into a folder named dataset with subfolders train and test. Each folder train and test obtain subfolders mask and no_mask.

Preprocessing

python png_to_hdf5.py

If you have not download the dataset for Multi-Person Object Detection and created the appropriate folder structure yet. Run:

python png_to_hdf5.py --mode train
python png_to_hdf5.py --mode test

Training SVM

python SVM.py

Training MobileNetV2

MobileNetV2 (Sandler et al., 2018)

From Scratch

python train.py

Finetune

python train.py --train_mode finetune

Multi-Person Object Detection

Dataset

For training, we used the following dataset from Kaggle Medical Mask Dataset. Put the files into a folder named dataset/detection with subfolders images and labels. Go To subfolder dataset/detection/images and delete the file 83855_1580055989W0WA.jpg.

Preprocessing

If you have not execute png_to_hdf5.py yet, run:

python png_to_hdf5.py

Otherwise run:

python png_to_hdf5.py --mode detection

Training

Faster-RCNN

Faster-RCNN (Ren et al., 2015)

python train.py --detection --train_mode faster_rcnn

MTCNN

MTCNN (Zhang et al., 2016)

python train.py --detection --train_mode mtcnn

Run our algorithm on your image

For the moment, your image has to be in the same folder as run.py:

python run.py --image_path

References

Ren, S., He, K., Girshick, R., & Sun, J. (2015). Faster R-CNN: Towards Real-Time Object Detection with Region Proposal NetworksarXiv e-prints, arXiv:1506.01497.

Sandler, M., Howard, A., Zhu, A., & Chen, L.C. (2018). MobileNetV2: Inverted Residuals and Linear BottlenecksarXiv e-prints, arXiv:1801.04381.

Szegedy, C., Liu, W., Jia, P., Reed, S., Anguelov, D., Vanhoucke, V., & Rabinovich, A. (2014). Going Deeper with ConvolutionsarXiv e-prints, arXiv:1409.4842.

Zhang, K., Zhang, Z., Li, Z., & Qiao, Y. (2016). Joint Face Detection and Alignment Using Multitask Cascaded Convolutional NetworksIEEE Signal Processing Letters, 23(10), 1499-1503.

Contact

[email protected]

License

MIT License

facemask-recognition's People

Contributors

thegialeo avatar

Watchers

James Cloos avatar  avatar Alfredo Sanz 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.