GithubHelp home page GithubHelp logo

mask-classifier's Introduction

Mask Classifier

Introduction

This repository contains codes for training and evaluating the Mask Classifier model, which is mostly implemented in Python 3 and Keras framework.

When training and testing the model, we mostly use SSH to detect and crop face images.

Please read our paper at here for further details on preparing the datasets as well as training and testing the model.

This project was supported by VinAI research.

People

Our team consists of four members including me (Thang Pham), Bao Tran, Duy Pham, and Long Nguyen.

This project was performed while the authors interned at VinAI research.

Model Performance

Our team has tried different network architectures and trained on different frameworks such as PyTorch, Keras, and Caffe.

We observed that deploying ResNet50 pretrained network brought us high accuracy model as well as fast training time.

During the experiment, the Mask Classifer model can achieve about 96.5% accuracy and a performance of 10-15 FPS on a Nvidia's GeForce GTX Titan X machine.

Some of the results

Contents

  1. Installation
  2. Running the demo
  3. Training a model

Installation

  1. Clone the repository:
git clone https://github.com/aome510/Mask-Classifier.git
  1. Setup SSH:
  1. Install python requirements:
pip install -r requirements.txt

Running the demo

To run the demo, first you need to download the pre-trained mask classifier model from here and then save it into a folder named model/.

After downloading the model, you can run demo on webcam:

python demo.py

If you want to demo on videos, you can download our demo videos from here and then save it into a folder named data/videos/. After that, you can modify demo.py to run demo on videos.

Training the model

Preparing the datasets

  1. CelebA dataset:

    You can download CelebA dataset from here and then save it into a folder named data/celebA/

  2. WiderFace dataset:

    You can download WiderFace dataset from here and then save it into a folder named data/WiderFace/

  3. MAFA dataset:

    You can download MAFA dataset from here and then save it into a folder named data/MAFA/

  4. Mask Classifier dataset (our dataset):

    You can download Mask Classifier dataset from here and then save it into a folder name data/mask_classifier/

Combining the datasets

After downloading all the datasets listed above you can run:

python gen_data.py

to combine the datasets and split them for training and cross-validating the model.

Training the model

After preparing the combined dataset, you can start training the model:

python train.py

By default, we use resnet50 network to train the model. You can change to reception_resnet_v2 network by modifying train.py.

Please read this if you want to train with diffrent network architectures.

mask-classifier's People

Contributors

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