demo: https://face-mask-detection-using-cnn-1.onrender.com
A deep learning model for detecting whether a person is wearing a face mask or not, built with PyTorch.
The system can:
Classify single images
Process batches of images from a directory
Perform real-time face mask detection using webcam
Detect multiple faces in an image and classify each one
The model achieves high accuracy in distinguishing between "with_mask" and "without_mask" classes.
The model is a custom convolutional neural network (CNN) with the following architecture:
- ConvBlock 1: 3→32 channels, MaxPool (128×128→64×64)
- ConvBlock 2: 32→64 channels, MaxPool (64×64→32×32)
- ConvBlock 3: 64→128 channels, MaxPool (32×32→16×16)
- ConvBlock 4: 128→256 channels, MaxPool (16×16→8×8)
- ConvBlock 5: 256→512 channels, MaxPool (8×8→4×4)
- Fully Connected 1: 8192→512 units with Dropout (0.5)
- Fully Connected 2: 512→2 units (with_mask, without_mask)
face_mask_video.mp4.mp4
- Clone the repository:
git clone https://github.com/olyadboka/face-mask-detection.git
cd face-mask-detection- Install dependencies:
pip install -r requirements.txt-
to Execute
python test.py --camera or python test.py --image image1.jpeg
