luigi12345
commited on
Commit
•
289ee6d
1
Parent(s):
c30c8d7
Update app.py
Browse files
app.py
CHANGED
@@ -95,7 +95,8 @@ def main():
|
|
95 |
st.set_page_config(layout="wide")
|
96 |
st.title("Batch Glaucoma Screening from Retinal Fundus Images")
|
97 |
|
98 |
-
|
|
|
99 |
confidence_threshold = st.sidebar.slider("Confidence Threshold (%)", 0, 100, 70)
|
100 |
uploaded_files = st.sidebar.file_uploader("Upload Images", type=['png', 'jpeg', 'jpg'], accept_multiple_files=True)
|
101 |
|
@@ -118,8 +119,9 @@ def main():
|
|
118 |
download_confident_images.append((cropped_image, uploaded_file.name))
|
119 |
|
120 |
# Display Results
|
121 |
-
with st.
|
122 |
-
|
|
|
123 |
cols[0].image(image_np, caption="Input Image", use_column_width=True)
|
124 |
cols[1].image(disc_cup_image, caption="Disc/Cup Segmentation", use_column_width=True)
|
125 |
cols[2].image(image_np, caption="Class Activation Map", use_column_width=True)
|
@@ -131,7 +133,7 @@ def main():
|
|
131 |
st.write(f"**Optic Disc Segmentation Confidence:** {disc_conf:.02f}%")
|
132 |
st.write(f"**Confidence Group:** {'Confident' if is_confident else 'Not Confident'}")
|
133 |
|
134 |
-
# Download
|
135 |
if download_confident_images:
|
136 |
with zipfile.ZipFile("confident_cropped_images.zip", "w") as zf:
|
137 |
for cropped_image, name in download_confident_images:
|
|
|
95 |
st.set_page_config(layout="wide")
|
96 |
st.title("Batch Glaucoma Screening from Retinal Fundus Images")
|
97 |
|
98 |
+
# Explanation for the confidence threshold
|
99 |
+
st.sidebar.write("**Confidence Threshold** (optional): Set a threshold to filter images based on the model's confidence in glaucoma classification.")
|
100 |
confidence_threshold = st.sidebar.slider("Confidence Threshold (%)", 0, 100, 70)
|
101 |
uploaded_files = st.sidebar.file_uploader("Upload Images", type=['png', 'jpeg', 'jpg'], accept_multiple_files=True)
|
102 |
|
|
|
119 |
download_confident_images.append((cropped_image, uploaded_file.name))
|
120 |
|
121 |
# Display Results
|
122 |
+
with st.container():
|
123 |
+
st.subheader(f"Results for {uploaded_file.name}")
|
124 |
+
cols = st.beta_columns(4) # Use st.beta_columns for compatibility with older Streamlit
|
125 |
cols[0].image(image_np, caption="Input Image", use_column_width=True)
|
126 |
cols[1].image(disc_cup_image, caption="Disc/Cup Segmentation", use_column_width=True)
|
127 |
cols[2].image(image_np, caption="Class Activation Map", use_column_width=True)
|
|
|
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:
|
138 |
with zipfile.ZipFile("confident_cropped_images.zip", "w") as zf:
|
139 |
for cropped_image, name in download_confident_images:
|