Skip to content

A python program based on yolov5 to detect if mask is worn, not worn or worn incorrectly.

Notifications You must be signed in to change notification settings

Khaledmohamedrefaat/Face-Mask-Detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Mask Detector: Detect Mask-Wear Correctness

Face Mask Detector Logo

What is Face Mask Detector?

  • 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.

Table of contents

Technologies

  • Programming Language: Python
  • GUI Framework: Tkinter
  • Deep Learning: Yolov5

Dataset

  • 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.

Model

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

Setup

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

Features

Use Still Image

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.

Mask Still Image

More Examples: woman-mask-split-04-ht-jt-210316_1615932165011_hpEmbed_4x3_992

face-recognition-test

GettyImages-1223601728_2_preview-c-d040c4f

Use Live Camera

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.

index

About

A python program based on yolov5 to detect if mask is worn, not worn or worn incorrectly.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages