A deep learning based system that can:
- Detect people not wearing face masks, mark them, and count the number of violations.
- Detect social distancing violations, mark them, and count the number of violations.
- yolov4-mask -> mask detection
- yolov4-tiny-mask -> mask detection
- yolov4-coco -> social distancing detection
- yolov4-tiny-coco -> social distancing detection
- Python 3.5–3.9
- pip 19.0 or later
The requirements are updated acording to which version of tensorflow the repository was lately tested on. Feel free to use Tensorflow 2.2-2.6
-
Note: For best performance, enable GPU for tensorflow. Check GPU support | Tensorflow for GPU support.
-
Clone the repository
-
(Optional) Create a virtual enviroment:
python -m venv mask-detector-env
and activate the enviroment using:
Platform Second Header Command to activate virtual environment POSIX bash/zsh $ source /bin/activate fish $ source /bin/activate.fish csh/tcsh $ source /bin/activate.csh PowerShell Core /bin/Activate.ps1 Windows cmd.exe C:> \Scripts\activate.bat PowerShell PS C:> \Scripts\Activate.ps1 -
Install requirments:
pip install -r requirements.txt
-
Download weights to be used from weights section
- yolov4-mask or yolov4-tiny-mask for mask detection
- yolov4 or yolov4-tiny for social distancing detection
- Update documentation and readme
- Implement a functionality that combines both mask and social distance violation detection
- Train yolov4-mask and add weights
- Social distancing detection
- Add yolov4-coco weights
- Add yolov4-tiny-coco weights
- Implement bird-eye view for social distancing detection
- Build a simple GUI
We collected images from multiple sources (mentioned in the Acknowledgements section), removed images that may lead to unwanted results, added new images for better results, and labeled all the images.
The new mask-dataset used to train the face mask detector.
- Python
- tensorflow
- Opencv
- Numpy
- Darknet
-
Dataset
-
Model