Skip to content

ObeidaElJundi/MasKorona

Repository files navigation

MasKorona

Coronavirus (aka. COVID)

Example

In December 2019, the world witnessed an aweful outbreak of coronavirus disease in China. Not a long time later, it has been spread in more than 100 countries. No vaccine is currently available!

One underrated way of minimizing spreading the virus and protecting ourselves from it is to wear a mask.

Example2

MasKorona utilizes Artificial Intelligence to distinguish mask-covered vs non-covered faces. MasKorona can be used in surveillance cameras in streets, offices, or crowded places such as supermarkets.

DEMO

Video can be found here.

Mask is ON: image

No mask: image

Video can be found here.

Dataset

Data contains images of faces with and without masks. Data size is as follows:

Mask No Mask
Training 180 528
Test 44 132

Data is collected & processed as following:

  1. Images were downloaded from Google Images using this chrome extension. Keywords used: face wearing corona mask, medical mask face, frontal face.
  2. Faces were extracted from all downloaded images using OpenCV. Extarcted faces were converted to black & white images and saved locally.

image

image

Training

For training, a pre-trainied ResNet34 has been fine-tuned. Full details are in this notebook: training.ipynb

image

image

To run notebooks:

  1. Download & install Anaconda (python 3.7 version)
  2. Create a new environment & download all necessary python packages from corona.yml:
conda env create -f corona.yml
  1. Activate created environement:
activate corona
  1. Download & install Jupyter Notebook:
conda install -c conda-forge notebook
  1. Run Jupyter Notebook:
jupyter notebook

and navigate to notebooks directory.

To try app with webcam, follow the previous steps till (including) step 3, then run script:

python corona_mask_webcam.py

NOTE: to run corona_mask_webcam.py, you need a pre-trained model, named export.pkl, in the same directory along with the script. My pre-trained model and data are not available for public yet!

About

utilizing Artificial Intelligence to distinguish mask-covered vs non-covered faces

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published