Update app.py
Browse files
app.py
CHANGED
@@ -180,15 +180,15 @@ if uploaded_file is not None:
|
|
180 |
# except: y_pred = np.zeros((128,128))
|
181 |
try: y_pred
|
182 |
except: y_pred = np.zeros((128,128))
|
183 |
-
|
184 |
# np.save("thresh.npy", y_pred)
|
185 |
|
186 |
-
plot_prediction(
|
187 |
|
188 |
if decompose:
|
189 |
# y_pred = np.load("thresh.npy")
|
190 |
|
191 |
-
cavs = decompose_cavity(
|
192 |
|
193 |
# ccd = CCDData(y_pred, unit="adu", wcs=wcs)
|
194 |
# ccd.write(f"predictions/predicted.fits", overwrite=True)
|
@@ -209,9 +209,9 @@ if uploaded_file is not None:
|
|
209 |
|
210 |
# shutil.make_archive("predictions", 'zip', "predictions")
|
211 |
|
212 |
-
with col6:
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
|
|
180 |
# except: y_pred = np.zeros((128,128))
|
181 |
try: y_pred
|
182 |
except: y_pred = np.zeros((128,128))
|
183 |
+
y_pred_th = np.where(y_pred > threshold, y_pred, 0)
|
184 |
# np.save("thresh.npy", y_pred)
|
185 |
|
186 |
+
plot_prediction(y_pred_th)
|
187 |
|
188 |
if decompose:
|
189 |
# y_pred = np.load("thresh.npy")
|
190 |
|
191 |
+
cavs = decompose_cavity(y_pred_th)
|
192 |
|
193 |
# ccd = CCDData(y_pred, unit="adu", wcs=wcs)
|
194 |
# ccd.write(f"predictions/predicted.fits", overwrite=True)
|
|
|
209 |
|
210 |
# shutil.make_archive("predictions", 'zip', "predictions")
|
211 |
|
212 |
+
# with col6:
|
213 |
+
# ccd = CCDData(y_pred, unit="adu", wcs=wcs)
|
214 |
+
# # with open('predictions.zip', 'rb') as f:
|
215 |
+
# # res = f.read()
|
216 |
+
# st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
|
217 |
+
# download = st.download_button(label="Download", data=ccd, file_name='prediction.fits', mime="application/octet-stream")
|