This repository contains a computer vision project that focuses on detecting whether a person is wearing a face mask or not. The project utilizes state-of-the-art deep learning techniques to analyze images or video streams from various sources, such as webcams or recorded videos, and provides real-time feedback on whether individuals in the frames are wearing masks or not.
- Introduction
- Installation
- Usage
- Model
- Dataset
- Training
- Evaluation
- Demo
- Future Enhancements
- Contributions
- License
The aim of this project is to contribute to public health efforts by automatically identifying whether individuals are wearing face masks. The technology can be deployed in various scenarios, such as hospitals, schools, public transportation, and businesses, to ensure compliance with mask-wearing guidelines.
-
Clone the repository:
git clone https://github.com/your-username/face-mask-detection.git cd face-mask-detection
-
Create a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
To use the face mask detection system:
-
Make sure you have the necessary dependencies installed by following the installation steps.
-
Run the detection script:
python detect_mask.py
-
The script will prompt you to provide the source of input (camera index or video path).
-
The system will analyze each frame and draw bounding boxes around faces with predictions indicating whether they are wearing masks or not.
The model architecture used for this project is based on CNN, a deep neural network optimized for face mask detection. The model is pretrained on a large dataset and fine-tuned on our custom dataset.
The dataset used for training and evaluation consists of images of individuals with and without face masks. It was collected from various sources and annotated manually. The dataset is divided into training, validation, and testing subsets.
To train the model:
-
Prepare the dataset by organizing the images into appropriate directories.
-
Run the training script:
python train.py --dataset /path/to/dataset --epochs 20
-
The script will initiate the training process and save the trained model.
To evaluate the model:
-
Run the evaluation script:
python evaluate.py --model /path/to/model --dataset /path/to/dataset
-
The script will assess the model's performance on the test dataset and display relevant metrics.
Check out our demo video showcasing the real-time face mask detection system in action.
We are actively working on improving the project:
- Multi-person detection.
- Mask type classification (surgical, N95, cloth, etc.).
- Integration with access control systems.
Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request.
This project is licensed under the MIT License.
Feel free to customize the content in this README.md
to match your project's specifics. Include any additional sections or information that you find relevant. Good luck with your face mask detection project!