A model trained to detect if is person is wearing Mask or not. A VGG16 model is used for training and then open cv is used to detect the mask.
This project is a simple face mask detection system using OpenCV and a deep learning model built using Keras. The model is trained on a dataset of images of people wearing masks and people without masks and it is capable of detecting the presence of masks in real-time using a webcam feed.
Python 3.x
Keras
OpenCV
Numpy
Pickle
Sklearn
Haarcascade_frontalface_default.xml file
Clone the repository to your local machine
Install the required packages mentioned in the Requirements section.
Run the Face_Mask_Model.py file to train the model and save it as a model1.pkl file.
Run the Face_Mask_Webcam.py file to start the webcam feed and detect masks in real-time.
Face_Mask_Model.py: This file trains the deep learning model and saves the trained model as a pickle file.
Face_Mask_Webcam.py: This file uses the trained model to detect masks in real-time using a webcam feed.
haarcascade_frontalface_default.xml: Haar cascade classifier used to detect faces in images.
Dataset: A folder containing the training images for the model.
This project provides a simple implementation of a face mask detection system and can be used in real-world applications to enforce mask-wearing policies. The model can be further improved by fine-tuning on a larger dataset and incorporating other computer vision techniques to improve accuracy.