Skip to content

nishadnp/Face-Mask-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face-Mask-Detection

About

The project is a face mask detection system that uses OpenCV for face detection and a Keras/TensorFlow model to classify whether a person is wearing a mask. The project demonstrates real-time video processing and deep learning-based classification. This project was originally developed as part of my college assignment. The current version has been organized and uploaded to GitHub for reference.

⚠️ Heads up: This project is meant mostly for showcasing. If you try to run it, brace yourself for some dependency and setup adventures.


Features

  • Detect faces in images or video streams.
  • Predict if a detected face is wearing a mask or not.
  • OpenCV DNN used for face detection.

Project Structure

Face-Mask-Detection/
├── dataset/ # Images used for training
├── face_detector/ # Pre-trained face detection models (Caffe)
│ ├── deploy.prototxt
│ └── res10_300x300_ssd_iter_140000.caffemodel
├── detect_mask.py # Real-time mask detection script
├── train_mask_detector.py # Script to train mask detection model
├── mask_detector.h5 # Trained model (generated after training. # Trained model (was originally mask_detector.model, now converted to H5 format)
├── requirements.txt # Python dependencies
└── README.md # Project documentation

Setup (if you dare)

  1. Clone the repository:

    git clone <repo-url>
    cd Face-Mask-Detection
  2. Create a virtual environment and activate it:

    python3 -m venv venv
    source venv/bin/activate  # Linux / macOS
    venv\Scripts\activate     # Windows
  3. Install dependencies:

    pip install -r requirements.txt
  4. Ensure these files exist:

    face_detector/deploy.prototxt

    face_detector/res10_300x300_ssd_iter_140000.caffemodel

    If missing or corrupted, grab them from OpenCV's GitHub: Face Detector Model Files

  5. Run detection (optional):

    python3 detect_mask.py

    If it runs, congratulations! If not, welcome to dependency hell. 😅


Notes

  • Developed for academic learning and demonstration.

  • Training the model is resource-intensive.

  • Cloning and running may require some patience and debugging.

  • Model training parameters were slightly adjusted from the original college version.

About

A Face Mask Detection System that uses OpenCV for face detection and a Keras/TensorFlow model to classify whether a person is wearing a mask. The project demonstrates real-time video processing and deep learning-based classification.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages