Giter Club home page Giter Club logo

maskdetection's Introduction

MaskDetection

What is MaskDetection?

To further help combat the coronavirus, Didi Chuxing decides to open up its face mask detection technology to the public for free. Developed by DiDi AI team, the mask detection technology is based on DFS face detection algorithm and the face attributes recognition algorithm DiDi employs on its platform. The model has overcome several difficulties like complex lighting changes in a day, face pose variety, face scales, etc. It uses weighted loss function and data augmentation methods to deal with different mask types and uneven mask data during the day and the night.

The system can identify non-mask drivers using their uploaded images with 99.5 per cent accuracy, and achieves 98 per cent accuracy during DiDi’s spot inspection with in-vehicle cameras. The model was trained on a dataset of 200,000 faces to ensure its robustness.

This quick detection system can be widely used in travel scenes, with mobile phone photos, surveillance images etc., and is able to work round the clock.

Requirements

  • google/protobuf
  • openblas or atlas
  • opencv
  • cuda/cudnn(if GPU is used)
  • Caffe

Installation

  • Clone the repository. We'll call the directory that you cloned as MASK_ROOT.
git clone [email protected]:didi/maskdetection.git

Usage

In this part, we assume you are in the directory $MASK_ROOT/

  • Install requirements (remember the install path to configure CMakeLists.txt)
  • Configure CMakeLists.txt、 test/CMakeLists.txt、 lib/CMakeLists.txt
  • Compile
mkdir build
cd build
cmake ..
make
  • After compilation, executable files will be generated in directory: build/bin
  • Detect the face bounding box, and then expand the bounding box to a certain proportion to get a detected face.
  • Run executable files with the detected face to judge if the face is wearing mask.

Tips:

  • The detected face bounding box is expanded to reduce the effect of detection errors.
  • Each side of the original face bounding box is expanded by 40% for mask detection. The proportion may be adjusted to the actual scenario/context(e.g., reduced to fit the actual scene in case of a dense crowd).

Model

  • Our model is pretrained by public ResNet50-caffemodel.
  • Trained by our collected private data.
  • Introduce attention mechanism.

License

Apache-2.0 license

maskdetection is licensed under the terms of the Apache license. See LICENSE for more information.

Note

DiDi's mask-recognition service is designed to better protect users from public health risks. An attention-learning mechanism is built in the technology to focus on recognizing the existence of a mask while weakening the recognition of other face areas. The service is subject to various sources of error including brightness, posture or partial image capture. We will continue to improve on the accuracy of the technology. Thank you for your support.

maskdetection's People

Contributors

wbtiger avatar

Watchers

James Cloos 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.