Final project of AI classes during last year of IT Engineering School. Face mask detector using Tensorflow 2 and Efficientdet D0 and D1 from its Object Detection API.
This project is the final class project of an AI classes during last year of IT Engineering School.
The main goal of this project is to develop and train an AI (completely or by using existing ones) that will detect faces with or without masks, and also improperly worn masks.
We will use the same classes as the Kaggle dataset :
with_mask
: the person is wearing a face mask properly,mask_weared_incorrect
: the person is wearing a face mask improperly,without_mask
: the person is not wearing a face mask.
We use the Efficientdet D1 and Efficientdet D0 AIs from the Tensorflow Object Detection API that we have trained with our custom dataset.
requirements.txt
filepython -m pip install -r requirements.txt
,FaceMaskDetector.py
script using same environment.```
To start inference on the eval dataset :
python FaceMaskDetector.py —eval [—version
To start inference on the camera stream :
python FaceMaskDetector.py —inference [—version
To start inference on a single image :
python FaceMaskDetector.py —inference [—version
To display the help message :
python FaceMaskDetector.py -h
usage: [-h] [-i] [-v {d0_v1,d1_v1}] [-f FILE_PATH] [-s] [-m MIN_SCORE] [-nv] [-c CAMERA_NAME]
optional arguments:
-h, —help Show this help message and exit
-i, —inference Start the Face Mask Detector in Inference mode on camera input or given image. Not adding this flag
will start the Face Mask Detector in Evaluation mode (run inferences on “images” folder).
-v {d0_v1,d1_v1}, —version {d0_v1,d1_v1}
Select the model to use.
-f FILE_PATH, —file FILE_PATH
Specify the input image for Inference mode instead of using camera. Ignored if evaluation mode is enabled.
-s, —save Images with detection results will be saved (not when using camera).
-m MIN_SCORE, —minScore MIN_SCORE
Set the minimum score to display a detection (between 0 and 1 inclusive).
-nv, —noviz Image(s) will not be displayed.
-c CAMERA_NAME, —camera CAMERA_NAME
Choosing camera/video stream to use. Default is 0.
```
Name | GitHub profile |
---|---|
Adrien JAUGEY | https://github.com/AdrienJaugey |
Bastien SUILLOT | https://github.com/Ricotimes |