- A python program that detects if mask is worn, not worn or worn incorrectly. The program is based on yolov5 model which was trained on custom dataset.
- The project was a part of a Kaggle Competition and got the first ranking in the leaderboard.
- Programming Language: Python
- GUI Framework: Tkinter
- Deep Learning: Yolov5
- The model was trained on a dataset:
- Training Set containing 3 classes:
- With Mask: x images.
- Without Mask: x images.
- Mask Worn Incorrectly: x images.
- Testing Set which was used for evaluation in kaggle.
- Training Set containing 3 classes:
The project was based on Yolov5 training on custom dataset, The dataset was training on Yolov5L model. For more information check : Yolov5 Repo.
The model was trained for 1000 epochs with 16 batches and got the following results:
- 0.4 MCRMS training error
- 0.5 MCRMS testing error
To run the python application you need to install the requirements (It is preffered to start a new environment and install all the requirements) using the following command
pip install -r requirements.txt
Browse and select any image, The program will automatically detect the faces and each face will passed to the pre-trained model for classification.
The output will be automatically displayed and also saved in ./runs/detect/
directory.
Instead of using an image, If you have a camera in your PC/Laptop, you can press "Use Live Camera" to get the classification done on the camera input.
Each frame will be passed to the model for classification and the output will be automatically shown and also the video will be saved in ./runs/detect/
directory.