Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,19 +25,20 @@ face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_fronta
|
|
| 25 |
with st.sidebar:
|
| 26 |
st.title("VisionGuard: Mask Monitor")
|
| 27 |
st.markdown("""
|
| 28 |
-
**VisionGuard** is a real-time
|
| 29 |
|
| 30 |
**How it works:**
|
| 31 |
- Upload or capture an image
|
| 32 |
-
-
|
| 33 |
-
- Results include confidence and visual feedback
|
| 34 |
|
| 35 |
-
This tool was built
|
| 36 |
|
| 37 |
**Built by:** Thirupathirao • 2025
|
| 38 |
""")
|
| 39 |
st.info("For best results, use clear, front-facing images with good lighting.")
|
| 40 |
-
st.caption("Empowering safety through
|
|
|
|
| 41 |
|
| 42 |
# Resize image
|
| 43 |
def resize_image(image, max_size=(400, 400)):
|
|
@@ -125,8 +126,9 @@ elif input_choice == "Use Webcam":
|
|
| 125 |
if confidence is not None:
|
| 126 |
st.metric("Confidence Score", f"{confidence*100:.2f}%")
|
| 127 |
if "Mask" in label:
|
| 128 |
-
st.
|
| 129 |
else:
|
| 130 |
-
st.
|
|
|
|
| 131 |
else:
|
| 132 |
st.warning(label)
|
|
|
|
| 25 |
with st.sidebar:
|
| 26 |
st.title("VisionGuard: Mask Monitor")
|
| 27 |
st.markdown("""
|
| 28 |
+
**VisionGuard** is a real-time system powered by **Convolutional Neural Networks (CNNs)** to help promote public health by detecting face mask compliance.
|
| 29 |
|
| 30 |
**How it works:**
|
| 31 |
- Upload or capture an image
|
| 32 |
+
- A CNN-based model detects face(s) and checks for mask presence
|
| 33 |
+
- Results include confidence levels and visual feedback
|
| 34 |
|
| 35 |
+
This tool was built as a deep learning project to demonstrate practical applications of CNNs in image classification tasks.
|
| 36 |
|
| 37 |
**Built by:** Thirupathirao • 2025
|
| 38 |
""")
|
| 39 |
st.info("For best results, use clear, front-facing images with good lighting.")
|
| 40 |
+
st.caption("Empowering safety through deep learning.")
|
| 41 |
+
|
| 42 |
|
| 43 |
# Resize image
|
| 44 |
def resize_image(image, max_size=(400, 400)):
|
|
|
|
| 126 |
if confidence is not None:
|
| 127 |
st.metric("Confidence Score", f"{confidence*100:.2f}%")
|
| 128 |
if "Mask" in label:
|
| 129 |
+
st.error("No mask detected! Please wear a mask in public spaces.")
|
| 130 |
else:
|
| 131 |
+
st.success("You're following safety measures!")
|
| 132 |
+
|
| 133 |
else:
|
| 134 |
st.warning(label)
|