A Real-Time Mask Detection Application with Deep Learning & OpenCV

This project is a real-time face mask detection system built using Deep Learning (CNN with TensorFlow/Keras) and OpenCV for computer vision tasks. The system detects human faces in live video streams using Haar Cascade Classifiers and classifies them as “mask” or “without mask” using a trained convolutional neural network. The application is integrated into a Django web framework, with seamless live video streaming and real-time annotation of faces with bounding boxes and classification labels. Deployment was carried out on Leapcell Cloud using Gunicorn, with necessary optimizations for handling OpenCV dependencies. The project highlights proficiency in neural networks, image processing, web application development, and cloud deployment.

computer_vision Oct. 2, 2025, 4:56 a.m.
View Live Project
Project Screenshot

Project Overview

The project is a real-time face mask detection system designed to enhance public health safety by automatically identifying whether individuals are wearing masks. It uses computer vision techniques and a trained deep learning model to detect human faces and classify them as either "mask" or "without mask".

Beyond accurate detection, the system emphasizes efficiency and usability. It can be integrated into surveillance systems, hospital entry points, schools, or workplaces to ensure compliance with mask policies during health emergencies such as COVID-19. The solution is lightweight enough to run on consumer-grade hardware while maintaining high detection accuracy.

Key features include:

  • Real-time face detection using OpenCV Haar Cascade classifiers
  • Deep learning model trained on labeled mask/no-mask datasets
  • Binary classification: "Mask" vs "Without Mask"
  • High accuracy with optimized Keras/TensorFlow model
  • Live webcam feed integration for continuous monitoring
  • Color-coded bounding boxes for clear visualization (green for mask, red for no mask)
  • Scalable for integration with CCTV and access control systems

This project highlights the blend of computer vision, machine learning, and practical deployment, offering a real-world solution to public safety monitoring through mask compliance detection.

Technologies & Skills

Django 5.1 Python 3.11 OpenCV TensorFlow Keras NumPy Pandas Matplotlib Gunicorn Pillow Scikit-learn tzdata pytz sqlparse python-dateutil requests cachetools