Plsek commited on
Commit
125c6bf
·
1 Parent(s): 9bf2a3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -15
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
- # # Make four columns for buttons
110
- # col1, col2, col3, col4 = st.columns(4)
111
- # col1.subheader("Input image")
112
- # col3.subheader("Prediction")
113
 
114
- # with col1:
115
- # st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
116
- # max_scale = int(data.shape[0] // 128)
117
- # # scale = int(st.selectbox('Scale:',[i+1 for i in range(max_scale)], label_visibility="hidden"))
118
- # scale = int(st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden"))
119
- # scale = scale.split("x")[0] // 128
120
 
121
- # with col2:
122
- # detect = st.button('Detect cavities')
123
 
124
- # with col3:
125
- # decompose = st.button('Docompose cavities')
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)