Update app.py
Browse files
app.py
CHANGED
|
@@ -161,6 +161,8 @@ with col:
|
|
| 161 |
|
| 162 |
# If file is uploaded, read in the data and plot it
|
| 163 |
if uploaded_file is not None:
|
|
|
|
|
|
|
| 164 |
with fits.open(uploaded_file) as hdul:
|
| 165 |
data = hdul[0].data
|
| 166 |
wcs = WCS(hdul[0].header)
|
|
@@ -227,12 +229,11 @@ if uploaded_file is not None:
|
|
| 227 |
except: image_decomposed = np.zeros((128,128))
|
| 228 |
plot_decomposed(image_decomposed)
|
| 229 |
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
download = st.download_button(label="Download", data=res, file_name='prediction.zip', mime="application/octet-stream")
|
|
|
|
| 161 |
|
| 162 |
# If file is uploaded, read in the data and plot it
|
| 163 |
if uploaded_file is not None:
|
| 164 |
+
fname = uploaded_file.strip(".fits")
|
| 165 |
+
|
| 166 |
with fits.open(uploaded_file) as hdul:
|
| 167 |
data = hdul[0].data
|
| 168 |
wcs = WCS(hdul[0].header)
|
|
|
|
| 229 |
except: image_decomposed = np.zeros((128,128))
|
| 230 |
plot_decomposed(image_decomposed)
|
| 231 |
|
| 232 |
+
with col6:
|
| 233 |
+
shutil.make_archive("predictions", 'zip', "predictions")
|
| 234 |
+
with open('predictions.zip', 'rb') as f:
|
| 235 |
+
res = f.read()
|
| 236 |
+
st.markdown("")
|
| 237 |
+
st.markdown("")
|
| 238 |
+
# st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
|
| 239 |
+
download = st.download_button(label="Download", data=res, file_name=f'{fname}_{int(scale*128)}.zip', mime="application/octet-stream")
|
|
|