Update app.py
Browse files
app.py
CHANGED
@@ -115,11 +115,11 @@ def decompose_cavity(pred, th2=0.7, amin=10):
|
|
115 |
xi, yi = X[b], Y[b]
|
116 |
img[xi, yi] = pred[xi, yi]
|
117 |
|
118 |
-
#
|
119 |
-
|
120 |
|
121 |
-
#
|
122 |
-
|
123 |
|
124 |
cavities.append(img)
|
125 |
|
@@ -231,5 +231,6 @@ if uploaded_file is not None:
|
|
231 |
shutil.make_archive("predictions", 'zip', "predictions")
|
232 |
with open('predictions.zip', 'rb') as f:
|
233 |
res = f.read()
|
|
|
234 |
# st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
|
235 |
download = st.download_button(label="Download", data=res, file_name='prediction.zip', mime="application/octet-stream")
|
|
|
115 |
xi, yi = X[b], Y[b]
|
116 |
img[xi, yi] = pred[xi, yi]
|
117 |
|
118 |
+
# THRESHOLDING #2
|
119 |
+
if not (img > th2).any(): continue
|
120 |
|
121 |
+
# MINIMAL AREA
|
122 |
+
if np.sum(img) <= amin: continue
|
123 |
|
124 |
cavities.append(img)
|
125 |
|
|
|
231 |
shutil.make_archive("predictions", 'zip', "predictions")
|
232 |
with open('predictions.zip', 'rb') as f:
|
233 |
res = f.read()
|
234 |
+
st.markdown("")
|
235 |
# st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
|
236 |
download = st.download_button(label="Download", data=res, file_name='prediction.zip', mime="application/octet-stream")
|