luigi12345
commited on
Commit
•
f752fee
1
Parent(s):
289ee6d
Update app.py
Browse files
app.py
CHANGED
@@ -119,19 +119,19 @@ def main():
|
|
119 |
download_confident_images.append((cropped_image, uploaded_file.name))
|
120 |
|
121 |
# Display Results
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
cols[3].image(cropped_image, caption="Cropped Image", use_column_width=True)
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
135 |
|
136 |
# Download Link for Confident Images
|
137 |
if download_confident_images:
|
|
|
119 |
download_confident_images.append((cropped_image, uploaded_file.name))
|
120 |
|
121 |
# Display Results
|
122 |
+
st.subheader(f"Results for {uploaded_file.name}")
|
123 |
+
cols = st.beta_columns(4) # Use st.beta_columns for compatibility with older Streamlit
|
124 |
+
cols[0].image(image_np, caption="Input Image", use_column_width=True)
|
125 |
+
cols[1].image(disc_cup_image, caption="Disc/Cup Segmentation", use_column_width=True)
|
126 |
+
cols[2].image(image_np, caption="Class Activation Map", use_column_width=True)
|
127 |
+
cols[3].image(cropped_image, caption="Cropped Image", use_column_width=True)
|
|
|
128 |
|
129 |
+
# Display confidence and metrics
|
130 |
+
st.write(f"**Vertical cup-to-disc ratio:** {vcdr:.04f}")
|
131 |
+
st.write(f"**Category:** {model.cls_id2label[disease_idx]} ({cls_conf:.02f}% confidence)")
|
132 |
+
st.write(f"**Optic Cup Segmentation Confidence:** {cup_conf:.02f}%")
|
133 |
+
st.write(f"**Optic Disc Segmentation Confidence:** {disc_conf:.02f}%")
|
134 |
+
st.write(f"**Confidence Group:** {'Confident' if is_confident else 'Not Confident'}")
|
135 |
|
136 |
# Download Link for Confident Images
|
137 |
if download_confident_images:
|