Detect face-masks in real-time camera stream
To run the program with live webcam stream:
python mask-detector.py
To run the program with custom source file (e.g. an mp4 video file):
python mask-detector.py --source videoplayback.mp4
Hit Esc
key to exit the program at any time.
The project is built using these libraries:
Tensorflow 2.1
Keras 2.3
Numpy 1.19
OpenCV 4.5
Matplotlib 3.3 (for testing only)
Python 3.6 is used.
The dataset for training the mask detection model is available here:
https://www.kaggle.com/omkargurav/face-mask-dataset
The dataset directory structure is modified in this format:
- data
- train
- 1_without_mask -> contains 2828 images
- 2_with_mask -> contains 2725 images
- test
- 1_without_mask -> contains 1000 images
- 2_with_mask -> contains 1000 images
- train
Created by Dharmveer Bharti
Under Computer Vision and Internet of Things Internship
by The Sparks Foundation