Skip to content

natton2k/YOLOv4-MaskDetection

Repository files navigation


Yolov4 for mask detection

Yolov4 mask detection using Darknet and OpenCV

Table of Contents

About The Project

Mask detection

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

*python 3.x:

https://www.python.org/downloads/

*numpy

pip install numpy

*openCV

For Window: https://pypi.org/project/opencv-python/

pip install opencv-python

For Raspberry 4, for the love of god please follow this link: https://qengineering.eu/install-opencv-4.4-on-raspberry-pi-4.html

Installation

Clone the repo

git clone https://github.com/TienTruong98/Hackathon

Setting up the libraries for the Melexis MLX90640

Check if the MLX90640 sensor is working correctly (see if the number 33 appear):
  sudo i2cdetect -y 1
  1. Install the visualization library in Python 3
sudo pip3 install matplotlib scipy numpy
  1. Install the I2C tools:
sudo apt-get install -y python-smbus
sudo apt-get install -y i2c-tools
  1. Install the Adafruit MLX90640 library:
sudo pip3 install RPI.GPIO adafruit-blinka
sudo pip3 install adafruit-circuitpython-mlx90640

Run the thermal camera script:

python3 thermal.py

Usage

To begin using this, you need to have 3 config files in the yolo-custom directory.

  • .names file
  • .cfg file
  • .weights file

We already have 6 files for 2 categories: face detection and mask detection. But feel free to customize your config.

~~ After that, you need to make sure that you have the correct file path at line 5, 6, 7 in detect.py ~~

~~ Ex: ~~ ~~ sh ~~ ~~ labels_path = "yolo-custom\\face.names" ~~ ~~ weights_path = "yolo-custom\yolov4-tiny-custom-face-detection.weights" ~~ ~~ config_path = "yolo-custom\yolov4-tiny-custom-face-detection.cfg" ~~ ~~ ~~ After that, you just need to run the run.py file in the command line to begin detect things. ~~ ~~ sh ~~ ~~ python run.py ~~ ~~ ~~

Contact

Truong Tran Tien - [email protected] Ngo Nguyen Bang - [email protected]

Acknowledgements

Troubleshooting

If you failed to run the Python code with the error: moduleNotFoundError: No module named 'board'

Please kindly uninstall the module by using the following bash command:

sudo pip3 uninstall board

TO-DO:


 1. 
 2.
 3.