Update app.py
Browse files
app.py
CHANGED
|
@@ -20,11 +20,13 @@ st.set_option('deprecation.showPyplotGlobalUse', False)
|
|
| 20 |
|
| 21 |
st.set_page_config(page_title="Cavity Detection Tool", layout="wide")
|
| 22 |
|
| 23 |
-
st.title("Cavity Detection Tool")
|
| 24 |
|
| 25 |
_, col, _ = st.columns([1, 3, 1])
|
| 26 |
|
| 27 |
with col:
|
|
|
|
|
|
|
| 28 |
st.markdown("Cavity Detection Tool (CADET) is a machine learning pipeline trained to detect X-ray cavities from noisy Chandra images of early-type galaxies. To use this tool: upload your image, select the scale of interest, and make a prediction! If you use this tool for your research, please cite [Plšek et al. 2023](https://arxiv.org/abs/2304.05457)")
|
| 29 |
|
| 30 |
st.markdown("Input images should be centered 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)).")
|
|
@@ -106,23 +108,23 @@ if uploaded_file is not None:
|
|
| 106 |
data = hdul[0].data
|
| 107 |
wcs = WCS(hdul[0].header)
|
| 108 |
|
| 109 |
-
#
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
|
| 121 |
-
|
| 122 |
-
|
| 123 |
|
| 124 |
-
|
| 125 |
-
|
| 126 |
|
| 127 |
# # Make two columns for plots
|
| 128 |
# colA, colB = st.columns(2)
|
|
|
|
| 20 |
|
| 21 |
st.set_page_config(page_title="Cavity Detection Tool", layout="wide")
|
| 22 |
|
| 23 |
+
# st.title("Cavity Detection Tool")
|
| 24 |
|
| 25 |
_, col, _ = st.columns([1, 3, 1])
|
| 26 |
|
| 27 |
with col:
|
| 28 |
+
st.markdown("# Cavity Detection Tool")
|
| 29 |
+
|
| 30 |
st.markdown("Cavity Detection Tool (CADET) is a machine learning pipeline trained to detect X-ray cavities from noisy Chandra images of early-type galaxies. To use this tool: upload your image, select the scale of interest, and make a prediction! If you use this tool for your research, please cite [Plšek et al. 2023](https://arxiv.org/abs/2304.05457)")
|
| 31 |
|
| 32 |
st.markdown("Input images should be centered 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)).")
|
|
|
|
| 108 |
data = hdul[0].data
|
| 109 |
wcs = WCS(hdul[0].header)
|
| 110 |
|
| 111 |
+
# Make four columns for buttons
|
| 112 |
+
_, col1, col2, col3, col4, _ = st.columns([1,0.75,0.75,0.75,0.75,,1])
|
| 113 |
+
col1.subheader("Input image")
|
| 114 |
+
col3.subheader("Prediction")
|
| 115 |
|
| 116 |
+
with col1:
|
| 117 |
+
st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
|
| 118 |
+
max_scale = int(data.shape[0] // 128)
|
| 119 |
+
# scale = int(st.selectbox('Scale:',[i+1 for i in range(max_scale)], label_visibility="hidden"))
|
| 120 |
+
scale = int(st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden"))
|
| 121 |
+
scale = scale.split("x")[0] // 128
|
| 122 |
|
| 123 |
+
with col2:
|
| 124 |
+
detect = st.button('Detect cavities')
|
| 125 |
|
| 126 |
+
with col3:
|
| 127 |
+
decompose = st.button('Docompose cavities')
|
| 128 |
|
| 129 |
# # Make two columns for plots
|
| 130 |
# colA, colB = st.columns(2)
|