Plsek commited on
Commit
a18eaf5
·
1 Parent(s): 9131113

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -22,7 +22,8 @@ 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")
@@ -109,32 +110,33 @@ if uploaded_file is not None:
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 = st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden")
121
  scale = int(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, colC, _ = st.columns([1,1,1,1,1])
131
 
132
  image = np.log10(data+1)
133
  plot_image(image, scale)
134
 
135
- # if detect:
136
- # data, wcs = cut(data, wcs, scale=scale)
137
- # image = np.log10(data+1)
138
 
139
  # y_pred = 0
140
  # for j in [0,1,2,3]:
 
22
 
23
  # st.title("Cavity Detection Tool")
24
 
25
+ bordersize = 0.8
26
+ _, col, _ = st.columns([bordersize, 3, bordersize])
27
 
28
  with col:
29
  st.markdown("# Cavity Detection Tool")
 
110
  wcs = WCS(hdul[0].header)
111
 
112
  # Make four columns for buttons
113
+ _, col1, col2, col3, col4, _ = st.columns([bordersize,0.75,0.75,0.75,0.75,bordersize])
114
  col1.subheader("Input image")
115
  col3.subheader("Prediction")
116
 
117
  with col1:
118
+ st.markdown("""<style>[data-baseweb="select"] {margin-top: -36px;}</style>""", unsafe_allow_html=True)
119
  max_scale = int(data.shape[0] // 128)
120
  # scale = int(st.selectbox('Scale:',[i+1 for i in range(max_scale)], label_visibility="hidden"))
121
  scale = st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden")
122
  scale = int(scale.split("x")[0]) // 128
123
 
124
  with col2:
125
+ st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
126
  detect = st.button('Detect cavities')
127
 
128
  with col3:
129
  decompose = st.button('Docompose cavities')
130
 
131
  # Make two columns for plots
132
+ _, colA, colB, colC, _ = st.columns([bordersize,1,1,1,bordersize])
133
 
134
  image = np.log10(data+1)
135
  plot_image(image, scale)
136
 
137
+ if detect:
138
+ data, wcs = cut(data, wcs, scale=scale)
139
+ image = np.log10(data+1)
140
 
141
  # y_pred = 0
142
  # for j in [0,1,2,3]: