Skip to content

The project leverages a pre-trained Mask R-CNN model fine-tuned on a custom dataset for accurate detection and classification. It includes functionalities for training, inference, and visualization of results, and it can be extended for real-time applications using OpenCV.

License

Notifications You must be signed in to change notification settings

Aymen016/MaskRCNN-FaceMaskDetection

Repository files navigation

✨ Mask Detection with Mask R-CNN ✨

Mask Detection

📊 Project Overview

This project leverages the power of Mask R-CNN to perform instance segmentation and classification of face masks in images. The system can identify:

  • 👷‍♂️ Faces with masks
  • 🚫 Faces without masks
  • 😕 Faces with incorrectly worn masks

The solution is implemented in Python and built upon the Mask R-CNN framework. It is designed for real-world applications like monitoring public spaces during a pandemic.


🎯 Features

  • 🔍 Instance Segmentation: Identifies mask-wearing status and segments faces in images.
  • 🎨 Customizable Classes: Extensible to detect other classes.
  • ⚙️ Pre-trained Weights: Utilizes COCO weights for transfer learning.
  • 🎮 Visualizations: Overlay predictions with bounding boxes and segmentation masks.
  • Real-time Applications: Can be integrated with OpenCV for live detection.

🛠️ Tools & Technologies

  • 🧬 Framework: Mask R-CNN
  • 🚀 Deep Learning: TensorFlow, Keras
  • 📊 Dataset Handling: XML Annotations, Numpy
  • 📚 Visualization: Matplotlib, Seaborn
  • ⚙️ Image Processing: OpenCV, Skimage
  • 📈 Training Data: Custom Dataset (Face Mask Detection)

🔢 Installation

Clone the Repository

$ git clone https://github.com/your-username/mask-detection-mask-rcnn.git
$ cd mask-detection-mask-rcnn

Install Dependencies

$ pip install -r requirements.txt

Download Pre-trained Weights

$ wget https://github.com/matterport/Mask_RCNN/releases/download/v2.0/mask_rcnn_coco.h5

🔄 Training Pipeline

  1. Dataset Preparation: Ensure images and XML annotations are placed in /images and /annotations directories, respectively.
  2. Configure Model: Update parameters in MaskConfig.
  3. Train Model:
    $ python train_model.py
  4. Fine-tune Model:
    $ python tune_model.py

🎨 Visualization

After training, visualize results on test images:

$ python visualize_results.py

🌐 Applications

  • 🔒 Public Safety: Monitoring mask compliance in public spaces.
  • 🔧 Access Control: Ensuring mask-wearing in restricted areas.
  • 🎮 AI Solutions: Integration with real-time systems like OpenCV.

⚖️ License

This project is licensed under the MIT License. See the LICENSE file for details.


📢 Contact

For any questions or feedback, feel free to reach out:


Thank you for checking out this project! 🚀

About

The project leverages a pre-trained Mask R-CNN model fine-tuned on a custom dataset for accurate detection and classification. It includes functionalities for training, inference, and visualization of results, and it can be extended for real-time applications using OpenCV.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published