face_mask_detection / pages /Problem Statement.py
Bhargavitippareddy's picture
Update pages/Problem Statement.py
d91ade3 verified
Raw
History Blame Contribute Delete
1.49 kB
import streamlit as st
import base64
st.set_page_config(page_title="About - Mask Detection", layout="centered")
# Function to set background image
def set_background(image_path):
with open(image_path, "rb") as img_file:
encoded = base64.b64encode(img_file.read()).decode()
st.markdown(
f"""
<style>
.stApp {{
background-image: url("data:image/jpg;base64,{encoded}");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}}
</style>
""",
unsafe_allow_html=True
)
# Set background image
set_background("IMAGE_1.jpg")
st.markdown("""
# 📘 About This Application
The goal of this application is to **predict whether a person is wearing a mask or not** using a trained deep learning model.
---
### ✅ Working Principle:
- This is a **binary classification problem**:
- **Class 0** → Mask Detected
- **Class 1** → No Mask Detected
---
### 🧠 Model Behavior:
- If the model **correctly detects a mask**, it draws a **green rectangle** around the person's face.
- If the model **detects no mask**, it draws a **red rectangle** around the face.
- It also displays the **confidence score** of the prediction (in percentage).
---
### 🖼️ Input Options:
- Upload a face image manually.
- Or use your **webcam** to capture a real-time photo.
---
Built with ❤️ using **Streamlit**, **OpenCV**, and **Keras**.
""")