Skip to content

natkowalczyk/thermal-mask-classification-and-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thermal mask on face classification and detection

Mask detection and classification in thermal face images

This repository allows testing mask detection and classification models on thermal images.

Mask classification

The proposed solution based on semi-supervised CNN with Convolutional Autoencoder (CAE) was provided in the classification folder. This model achieved 91% accuracy in face mask classification on thermal images. To test the model you can use thermal images of three types of masks given in the images folder.

Requirements

For installing the required packages, run the following command:

pip install -r requirements.txt

Classify image

To run mask classification you should use:

>> python mask_classification.py --img_path <path to image>

For example: python mask_classification.py --img_path ../images/cloth.jpg

Mask detection

The best model weights are provided in the detection folder - Yolov5 in "nano" version trained on a thermal images dataset with weights obtained on the COCO set. For this model obtained metrics were:

  • precision 0.964 ± 0.025,
  • recall 0.935 ± 0.006,
  • mAP50 0.970 ± 0.013.

To detect mask on face you can also use images given in images folder.

To run detection you should use Yolov5 by Ultralytics.

>> python detect.py --weights <path to weights> --source <path to image>

For example: python detect.py --weights best.pt --source cloth.jpg

Paper citation

Kowalczyk, N., and Rumiński J. "Mask detection and classification in thermal face images." - in review

About

Mask detection and classification in thermal face images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages