Update app.py
Browse files
app.py
CHANGED
|
@@ -125,12 +125,12 @@ def decompose_cavity(pred, th2=0.7, amin=10):
|
|
| 125 |
|
| 126 |
return cavities
|
| 127 |
|
| 128 |
-
@st.cache
|
| 129 |
-
def zip_predictions():
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
|
| 135 |
bordersize = 0.6
|
| 136 |
_, col, _ = st.columns([bordersize, 3, bordersize])
|
|
@@ -219,6 +219,8 @@ if uploaded_file is not None:
|
|
| 219 |
plot_decomposed(image_decomposed)
|
| 220 |
|
| 221 |
with col6:
|
| 222 |
-
|
|
|
|
|
|
|
| 223 |
st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
|
| 224 |
download = st.download_button(label="Download", data=res, file_name='prediction.fits', mime="application/octet-stream")
|
|
|
|
| 125 |
|
| 126 |
return cavities
|
| 127 |
|
| 128 |
+
# @st.cache
|
| 129 |
+
# def zip_predictions():
|
| 130 |
+
# shutil.make_archive("predictions.zip", 'zip', "predictions")
|
| 131 |
+
# with open('predictions.zip', 'rb') as f:
|
| 132 |
+
# res = f.read()
|
| 133 |
+
# return res
|
| 134 |
|
| 135 |
bordersize = 0.6
|
| 136 |
_, col, _ = st.columns([bordersize, 3, bordersize])
|
|
|
|
| 219 |
plot_decomposed(image_decomposed)
|
| 220 |
|
| 221 |
with col6:
|
| 222 |
+
shutil.make_archive("predictions.zip", 'zip', "predictions")
|
| 223 |
+
with open('predictions.zip', 'rb') as f:
|
| 224 |
+
res = f.read()
|
| 225 |
st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
|
| 226 |
download = st.download_button(label="Download", data=res, file_name='prediction.fits', mime="application/octet-stream")
|