/NTUSTxIntel--MaskFaceDetection

To detect human beings wearing mask or not.

Primary LanguageJupyter Notebook

Masked Face Detection(openvino)

Get the Best Class-project Award from Intel~!

Objective

Collect the people’s’ information while they get into/out a place e.g. convenience store, school, etc. And then we can do some analysis. People’s’ information contains

  • Wearing mask or not
  • Age
  • Gender
  • Timestamp

Requirements

Install Openvino first.

numpy
tensorflow>=1.12.1
opencv
keras
dlib
pandas
pyqt5

How to run?

$ cd mask_detection
$ {your path to openvino directory}\bin\setupvars.bat
$ python .\main.py
argument default description
face_threshold 0.5 IR face-detection model will give each face a confidence, this threshold can restrict the face to display
input_file '' test_video path (*.mp4, *.avi), if it's not specified, we will read webcam.
save_video '' save_video path(*.mp4, *.avi)
save_data '' save_collected_data path(*.csv)

What did I do?

  1. Train a MaskFaceClassifier

    • In mask_classifier_model_training
  2. Use openvino pretrained model to detect face and classify face age and gender

  3. Add Tracker to speed up

  4. Add crossline and build a gui (while a person crossing the line, right side will pop up the classify result)

  5. Add DataCollector to collect data from classifier

For classifier training

Data source

For tracker

Pros:

  • Have higher speed.
  • Detection is more computation expensive than tracker. (And we only have cpu.)

Cons:

  • Have lower accuracy.
  • Tracker track the face by correlation of image

Data collected

What can we do after collect these data?