Downloads · 30 days
9
45% of all-time downloads
sreenathsree1578/face_mask_detection
face_mask_detection is a machine learning model from sreenathsree1578. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Name: Mask Detection CNN Author: Your Name Date: 2025-09-26 Framework: Keras (TensorFlow backend) Format: HDF5 (.h5) License: MIT / CC0 (choose as needed)
Downloads · 30 days
9
45% of all-time downloads
All-time downloads
20
Public
Repo size
88.9 MB
Likes
0
Public
Click a slice to open those files.
.h588.9 MB · 100%
From the Hugging Face model README
Name: Mask Detection CNN
Author: Your Name
Date: 2025-09-26
Framework: Keras (TensorFlow backend)
Format: HDF5 (.h5)
License: MIT / CC0 (choose as needed)
This model is designed to detect whether a person is wearing a mask or not from images of faces. It can be used in real-time applications such as webcam-based mask detection or image classification.
(128, 128, 3)128x128 pixels[0, 1]0: Mask1: No Maskargmax(output)import cv2
import numpy as np
from keras.models import load_model
# Load model
model = load_model("mask_detection_model.h5")
# Load image
image = cv2.imread("face.jpg")
image_resized = cv2.resize(image, (128, 128))
image_scaled = image_resized.astype("float32") / 255.0
image_input = np.expand_dims(image_scaled, axis=0)
# Predict
prediction = model.predict(image_input)
pred_label = np.argmax(prediction, axis=1)[0]
if pred_label == 0:
print("Mask 😷✅")
else:
print("No Mask ❌")