This face mask detection program detects faces using a webcam and applies a machine learning model to determine whether or not the person is wearing a mask. It can be used to ensure people entering a classroom or family gathering are wearing a mask by simply setting it up near the entrance. A text-to-speech feature is also implemented in this program to remind people who are not wearing a mask to wear a mask.
To train the machine learning model, we have used a dataset from the Kaggle platform.
As we were working with image data, the best tool for this is a Convolutional Neural Network (CNN). This deep learning model can find patterns in the data in order to classify images. More details on training this model can be viewed in this file: face_mask_detector.ipynb.
- Python - the coding language that was used to make this project
- Keras - the deep learning framework that is used to train the machine learning model
- OpenCV - the library that was used to process images when training the model and also to access the webcam to detect faces
Demo_1.mp4 |
Demo_2.mp4 |
- First download the repository
- Then install requirements.txt to download all the required modules to run this program
pip install -r requirements.txt
- Run
face_mask_detection.py - You should now be able to use this program successfully
- @thuvaragan25 - Worked on implementing the Convolutional Neural Network and training the machine learning model
- @mdola19 - Worked on detecting faces in live webcam feed to look for face masks using the machine learning model and displaying results