Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -96,7 +96,11 @@ if input_choice == "📤 Upload Image":
|
|
| 96 |
st.image(result_img, caption="Detection Output")
|
| 97 |
if confidence is not None:
|
| 98 |
st.metric("Confidence Score", f"{confidence*100:.2f}%")
|
| 99 |
-
st.success(label) if "Mask" in label else st.error(label)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
else:
|
| 101 |
st.warning(label)
|
| 102 |
|
|
@@ -114,9 +118,15 @@ elif input_choice == "📷 Use Webcam":
|
|
| 114 |
result_img, confidence, label = detect_and_predict(image_input)
|
| 115 |
|
| 116 |
with col2:
|
|
|
|
| 117 |
st.image(result_img, caption="Detection Output")
|
| 118 |
if confidence is not None:
|
| 119 |
st.metric("Confidence Score", f"{confidence*100:.2f}%")
|
| 120 |
-
st.success(label) if "Mask" in label else st.error(label)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
else:
|
| 122 |
st.warning(label)
|
|
|
|
| 96 |
st.image(result_img, caption="Detection Output")
|
| 97 |
if confidence is not None:
|
| 98 |
st.metric("Confidence Score", f"{confidence*100:.2f}%")
|
| 99 |
+
# st.success(label) if "Mask" in label else st.error(label)
|
| 100 |
+
if "Mask" in label:
|
| 101 |
+
st.success(label)
|
| 102 |
+
else:
|
| 103 |
+
st.error(label)
|
| 104 |
else:
|
| 105 |
st.warning(label)
|
| 106 |
|
|
|
|
| 118 |
result_img, confidence, label = detect_and_predict(image_input)
|
| 119 |
|
| 120 |
with col2:
|
| 121 |
+
st.write("Resulted Image")
|
| 122 |
st.image(result_img, caption="Detection Output")
|
| 123 |
if confidence is not None:
|
| 124 |
st.metric("Confidence Score", f"{confidence*100:.2f}%")
|
| 125 |
+
# st.success(label) if "Mask" in label else st.error(label)
|
| 126 |
+
if "Mask" in label:
|
| 127 |
+
st.success(label)
|
| 128 |
+
else:
|
| 129 |
+
st.error(label)
|
| 130 |
+
|
| 131 |
else:
|
| 132 |
st.warning(label)
|