Face-Mask-Detector
Face-Mask-Detector copied to clipboard
A face mask detector based on STM32F103ZET6 and Yolov4.
Face-Mask-Detector
A face mask detector based on STM32F103ZET6 and Yolov4.
Interface

Compile and Load
You should install arm-none-eabi-gcc to compile this project.
cd stm32
make update
Build Environment
-
Create virtual environment:
conda create -n Face_Mask_Detector python=3.8 conda activate Face_Mask_Detector pip install -r requirements.txt
Train
-
Download face mask dataset from kaggle and unzip it.
-
Download pre-trained
CSPDarknet53.pthmodel from Google Drive. -
Modify the value of
rootintrain.py, please ensure that the directory structure of therootfolder is as follows:root ├───Annotations ├───ImageSets │ ├───Layout │ ├───Main │ └───Segmentation ├───JPEGImages ├───SegmentationClass └───SegmentationObject -
start training:
conda activate Face_Mask_Detector python train.py
Evaluation
one model
-
Modify the value of
rootandmodel_pathineval.py. -
Calculate mAP:
conda activate Face_Mask_Detector python eval.py
multi models
-
Modify the value of
rootandmodel_dirinevals.py. -
Calculate and plot mAP:
conda activate Face_Mask_Detector python evals.py
mAP curve

Detection
-
Modify the
model_pathandimage_pathindemo.py. -
Display detection results:
conda activate Face_Mask_Detector python demo.py
License
Face-Mask-Detector is licensed under GPLv3.
Copyright © 2021 by zhiyiYo.