File size: 1,493 Bytes
3025c7f
d91ade3
3025c7f
 
19dd959
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3025c7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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**.
""")