A face mask detector based on STM32F103ZET6 and Yolov4.
You should install arm-none-eabi-gcc
to compile this project.
cd stm32
make update
-
Create virtual environment:
conda create -n Face_Mask_Detector python=3.8 conda activate Face_Mask_Detector pip install -r requirements.txt
-
Download face mask dataset from kaggle and unzip it.
-
Download pre-trained
CSPDarknet53.pth
model from Google Drive. -
Modify the value of
root
intrain.py
, please ensure that the directory structure of theroot
folder is as follows:root ├───Annotations ├───ImageSets │ ├───Layout │ ├───Main │ └───Segmentation ├───JPEGImages ├───SegmentationClass └───SegmentationObject
-
start training:
conda activate Face_Mask_Detector python train.py
-
Modify the value of
root
andmodel_path
ineval.py
. -
Calculate mAP:
conda activate Face_Mask_Detector python eval.py
-
Modify the value of
root
andmodel_dir
inevals.py
. -
Calculate and plot mAP:
conda activate Face_Mask_Detector python evals.py
-
Modify the
model_path
andimage_path
indemo.py
. -
Display detection results:
conda activate Face_Mask_Detector python demo.py
Face-Mask-Detector is licensed under GPLv3.
Copyright © 2021 by zhiyiYo.