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.
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.
Video can be found here.
Video can be found here.
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:
- Images were downloaded from Google Images using this chrome extension. Keywords used: face wearing corona mask, medical mask face, frontal face.
- Faces were extracted from all downloaded images using OpenCV. Extarcted faces were converted to black & white images and saved locally.
For training, a pre-trainied ResNet34 has been fine-tuned. Full details are in this notebook: training.ipynb
To run notebooks:
- Download & install Anaconda (python 3.7 version)
- Create a new environment & download all necessary python packages from corona.yml:
conda env create -f corona.yml
- Activate created environement:
activate corona
- Download & install Jupyter Notebook:
conda install -c conda-forge notebook
- 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!