Update app.py
Browse files
app.py
CHANGED
@@ -148,9 +148,18 @@ with col:
|
|
148 |
st.markdown("To use this tool: upload your image, select the scale of interest, and make a prediction!")
|
149 |
st.markdown("Input images should be centred at the centre of the galaxy and point sources should be filled with surrounding background ([dmfilth](https://cxc.cfa.harvard.edu/ciao/ahelp/dmfilth.html)).")
|
150 |
st.markdown("If you use this tool for your research, please cite [Plšek et al. 2023](https://arxiv.org/abs/2304.05457)")
|
151 |
-
|
|
|
|
|
|
|
152 |
# Create file uploader widget
|
153 |
uploaded_file = st.file_uploader("Choose a FITS file", type=['fits'])
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
# If file is uploaded, read in the data and plot it
|
156 |
if uploaded_file is not None:
|
@@ -168,9 +177,9 @@ if uploaded_file is not None:
|
|
168 |
with col1:
|
169 |
# st.markdown("""<style>[data-baseweb="select"] {margin-top: -26px;}</style>""", unsafe_allow_html=True)
|
170 |
# st.markdown("<style>{margin-top: -26px;}</style>", unsafe_allow_html=True)
|
171 |
-
st.markdown("<br style='margin:-
|
172 |
max_scale = int(data.shape[0] // 128)
|
173 |
-
scale = st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden")
|
174 |
scale = int(scale.split("x")[0]) // 128
|
175 |
|
176 |
# Detect button
|
@@ -180,7 +189,7 @@ if uploaded_file is not None:
|
|
180 |
with col4:
|
181 |
st.markdown("")
|
182 |
# st.markdown("""<style>[data-baseweb="select"] {margin-top: -36px;}</style>""", unsafe_allow_html=True)
|
183 |
-
threshold = st.slider("Threshold", 0.0, 1.0,
|
184 |
|
185 |
# Decompose button
|
186 |
with col5: decompose = st.button('Decompose', key="decompose")
|
|
|
148 |
st.markdown("To use this tool: upload your image, select the scale of interest, and make a prediction!")
|
149 |
st.markdown("Input images should be centred at the centre of the galaxy and point sources should be filled with surrounding background ([dmfilth](https://cxc.cfa.harvard.edu/ciao/ahelp/dmfilth.html)).")
|
150 |
st.markdown("If you use this tool for your research, please cite [Plšek et al. 2023](https://arxiv.org/abs/2304.05457)")
|
151 |
+
|
152 |
+
_, col_1, col_2, _ = st.columns([bordersize, 2.5, 0.5, bordersize])
|
153 |
+
|
154 |
+
with col1:
|
155 |
# Create file uploader widget
|
156 |
uploaded_file = st.file_uploader("Choose a FITS file", type=['fits'])
|
157 |
+
|
158 |
+
with col2:
|
159 |
+
example = st.button("Example")
|
160 |
+
|
161 |
+
def change_state(b):
|
162 |
+
st.session_state.value = 0.0
|
163 |
|
164 |
# If file is uploaded, read in the data and plot it
|
165 |
if uploaded_file is not None:
|
|
|
177 |
with col1:
|
178 |
# st.markdown("""<style>[data-baseweb="select"] {margin-top: -26px;}</style>""", unsafe_allow_html=True)
|
179 |
# st.markdown("<style>{margin-top: -26px;}</style>", unsafe_allow_html=True)
|
180 |
+
st.markdown("<br style='margin:-44px 0'>", unsafe_allow_html=True)
|
181 |
max_scale = int(data.shape[0] // 128)
|
182 |
+
scale = st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden", on_change=change_state)
|
183 |
scale = int(scale.split("x")[0]) // 128
|
184 |
|
185 |
# Detect button
|
|
|
189 |
with col4:
|
190 |
st.markdown("")
|
191 |
# st.markdown("""<style>[data-baseweb="select"] {margin-top: -36px;}</style>""", unsafe_allow_html=True)
|
192 |
+
threshold = st.slider("Threshold", 0.0, 1.0, st.session_state.value, 0.05) #, label_visibility="hidden")
|
193 |
|
194 |
# Decompose button
|
195 |
with col5: decompose = st.button('Decompose', key="decompose")
|