Update app.py
Browse files
app.py
CHANGED
|
@@ -81,7 +81,7 @@ if uploaded_file is not None:
|
|
| 81 |
data = hdul[0].data
|
| 82 |
wcs = WCS(hdul[0].header)
|
| 83 |
|
| 84 |
-
# Make
|
| 85 |
col1, col2, col3, col4 = st.columns(4)
|
| 86 |
col1.subheader("Input image")
|
| 87 |
col3.subheader("Prediction")
|
|
@@ -91,16 +91,14 @@ if uploaded_file is not None:
|
|
| 91 |
smooth = st.button("Smooth")
|
| 92 |
|
| 93 |
with col2:
|
| 94 |
-
|
| 95 |
-
st.markdown("""<style>[data-baseweb="select"] {margin-top: 22px;}</style>""", unsafe_allow_html=True)
|
| 96 |
-
|
| 97 |
max_scale = int(data.shape[0] // 128)
|
| 98 |
-
# scale = st.slider("Scale", 1, max_scale, 1, 1)
|
| 99 |
scale = int(st.selectbox('Scale:',[i+1 for i in range(max_scale)], label_visibility="hidden"))
|
| 100 |
|
| 101 |
with col3:
|
| 102 |
detect = st.button('Detect cavities')
|
| 103 |
|
|
|
|
| 104 |
colA, colB = st.columns(2)
|
| 105 |
|
| 106 |
image = np.log10(data+1)
|
|
@@ -126,9 +124,10 @@ if uploaded_file is not None:
|
|
| 126 |
ccd = CCDData(y_pred, unit="adu", wcs=wcs)
|
| 127 |
ccd.write("predicted.fits", overwrite=True)
|
| 128 |
with open('predicted.fits', 'rb') as f:
|
| 129 |
-
|
| 130 |
|
| 131 |
with col4:
|
| 132 |
-
|
|
|
|
| 133 |
# # download = st.button('Download')
|
| 134 |
-
# download = st.download_button(label="Download", data=
|
|
|
|
| 81 |
data = hdul[0].data
|
| 82 |
wcs = WCS(hdul[0].header)
|
| 83 |
|
| 84 |
+
# Make four columns for buttons
|
| 85 |
col1, col2, col3, col4 = st.columns(4)
|
| 86 |
col1.subheader("Input image")
|
| 87 |
col3.subheader("Prediction")
|
|
|
|
| 91 |
smooth = st.button("Smooth")
|
| 92 |
|
| 93 |
with col2:
|
| 94 |
+
st.markdown("""<style>[data-baseweb="select"] {margin-top: 17px;}</style>""", unsafe_allow_html=True)
|
|
|
|
|
|
|
| 95 |
max_scale = int(data.shape[0] // 128)
|
|
|
|
| 96 |
scale = int(st.selectbox('Scale:',[i+1 for i in range(max_scale)], label_visibility="hidden"))
|
| 97 |
|
| 98 |
with col3:
|
| 99 |
detect = st.button('Detect cavities')
|
| 100 |
|
| 101 |
+
# Make two columns for plots
|
| 102 |
colA, colB = st.columns(2)
|
| 103 |
|
| 104 |
image = np.log10(data+1)
|
|
|
|
| 124 |
ccd = CCDData(y_pred, unit="adu", wcs=wcs)
|
| 125 |
ccd.write("predicted.fits", overwrite=True)
|
| 126 |
with open('predicted.fits', 'rb') as f:
|
| 127 |
+
res = f.read()
|
| 128 |
|
| 129 |
with col4:
|
| 130 |
+
pass
|
| 131 |
+
# st.markdown("""<style>[data-baseweb="select"] {margin-top: 32px;}</style>""", unsafe_allow_html=True)
|
| 132 |
# # download = st.button('Download')
|
| 133 |
+
# download = st.download_button(label="Download", data=res, file_name="predicted.fits", mime="application/octet-stream")
|