In the present scenario due to Covid-19, there is no efficient face mask detection applications which are now in high demand for transportation means, densely populated areas, residential districts, large-scale manufacturers and other enterprises to ensure safety. Also, the absence of large datasets of ‘with_mask’ images has made this task more cumbersome and challenging.
Paper Yolo v4: https://arxiv.org/abs/2004.10934
YOLO is a clever convolutional neural network (CNN) for doing object detection in real-time. The algorithm applies a single neural network to the full image, and then divides the image into regions and predicts bounding boxes and probabilities for each region.
- Clone this repository
- Clone AlexyAB's darknet implementation
- Follow AlexyAB's README to build the repo. Run the demo successfully
- Copy this repo's
mask.py
and paste it into./darknet/
- Copy this repo's
yolo-obj.cfg
and paste it into./darknet/cfg/
- Copy this repo's
obj.data
and paste it into./darknet/cfg
- Copy this repo's
obj.name
and paste it into./darknet/data/
- You can find pre-trained weights here
There are 2 weight files one is using Roboflow's mask dataset that is good for mask detection in cloase range and the other one is a custom dataset made by Aditya Purohit to which I have added my own data.
Follow the notebook that is included in the repository.
The dataset used can be downloaded here - Click to Download
Roboflow :- How to Train YOLOv4 on a Custom Dataset