Plsek commited on
Commit
36a5e8a
·
1 Parent(s): 3138cd3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -117,18 +117,18 @@ if uploaded_file is not None:
117
  col3.subheader("Prediction")
118
  col5.subheader("Decomposed")
119
 
120
- with col2:
121
  # st.markdown("""<style>[data-baseweb="select"] {margin-top: -56px;}</style>""", unsafe_allow_html=True)
122
  max_scale = int(data.shape[0] // 128)
123
  # scale = int(st.selectbox('Scale:',[i+1 for i in range(max_scale)], label_visibility="hidden"))
124
  scale = st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden")
125
  scale = int(scale.split("x")[0]) // 128
126
 
127
- with col4:
128
  # st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
129
  detect = st.button('Detect')
130
 
131
- with col6:
132
  decompose = st.button('Docompose')
133
 
134
  # Make two columns for plots
@@ -149,11 +149,12 @@ if uploaded_file is not None:
149
  pred = np.rot90(pred, -j)
150
  y_pred += pred / 4
151
 
152
- # Thresholding
153
- y_pred = np.where(y_pred > threshold, y_pred, 0)
154
-
155
  with colB:
156
  threshold = st.slider("", 0.0, 1.0, 0.4, 0.05, label_visibility="hidden")
 
 
 
 
157
  plot_prediction(y_pred)
158
 
159
  # if decompose:
 
117
  col3.subheader("Prediction")
118
  col5.subheader("Decomposed")
119
 
120
+ with col1:
121
  # st.markdown("""<style>[data-baseweb="select"] {margin-top: -56px;}</style>""", unsafe_allow_html=True)
122
  max_scale = int(data.shape[0] // 128)
123
  # scale = int(st.selectbox('Scale:',[i+1 for i in range(max_scale)], label_visibility="hidden"))
124
  scale = st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden")
125
  scale = int(scale.split("x")[0]) // 128
126
 
127
+ with col3:
128
  # st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
129
  detect = st.button('Detect')
130
 
131
+ with col5:
132
  decompose = st.button('Docompose')
133
 
134
  # Make two columns for plots
 
149
  pred = np.rot90(pred, -j)
150
  y_pred += pred / 4
151
 
 
 
 
152
  with colB:
153
  threshold = st.slider("", 0.0, 1.0, 0.4, 0.05, label_visibility="hidden")
154
+
155
+ # Thresholding
156
+ y_pred = np.where(y_pred > threshold, y_pred, 0)
157
+
158
  plot_prediction(y_pred)
159
 
160
  # if decompose: