Update app.py
Browse files
app.py
CHANGED
|
@@ -122,7 +122,7 @@ if uploaded_file is not None:
|
|
| 122 |
# scale = int(st.selectbox('Scale:',[i+1 for i in range(max_scale)], label_visibility="hidden"))
|
| 123 |
scale = st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden")
|
| 124 |
scale = int(scale.split("x")[0]) // 128
|
| 125 |
-
st.markdown("""<style>[data-baseweb="select"] {margin-top:
|
| 126 |
|
| 127 |
with col3:
|
| 128 |
# st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
|
|
@@ -136,8 +136,12 @@ if uploaded_file is not None:
|
|
| 136 |
|
| 137 |
image = np.log10(data+1)
|
| 138 |
plot_image(image, scale)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
|
| 140 |
-
if detect:
|
| 141 |
data, wcs = cut(data, wcs, scale=scale)
|
| 142 |
image = np.log10(data+1)
|
| 143 |
|
|
@@ -148,13 +152,8 @@ if uploaded_file is not None:
|
|
| 148 |
pred = np.rot90(pred, -j)
|
| 149 |
y_pred += pred / 4
|
| 150 |
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
threshold = st.slider("", 0.0, 1.0, 0.0, 0.05, label_visibility="hidden")
|
| 154 |
-
if threshold > 0: detect = True
|
| 155 |
-
y_pred = np.where(y_pred > threshold, y_pred, 0)
|
| 156 |
-
# plot_prediction(y_pred)
|
| 157 |
-
|
| 158 |
plot_prediction(y_pred)
|
| 159 |
|
| 160 |
with colC:
|
|
|
|
| 122 |
# scale = int(st.selectbox('Scale:',[i+1 for i in range(max_scale)], label_visibility="hidden"))
|
| 123 |
scale = st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden")
|
| 124 |
scale = int(scale.split("x")[0]) // 128
|
| 125 |
+
st.markdown("""<style>[data-baseweb="select"] {margin-top: 30px;}</style>""", unsafe_allow_html=True)
|
| 126 |
|
| 127 |
with col3:
|
| 128 |
# st.markdown("""<style>[data-baseweb="select"] {margin-top: 16px;}</style>""", unsafe_allow_html=True)
|
|
|
|
| 136 |
|
| 137 |
image = np.log10(data+1)
|
| 138 |
plot_image(image, scale)
|
| 139 |
+
|
| 140 |
+
with col3:
|
| 141 |
+
st.markdown("""<style>[data-baseweb="select"] {margin-top: -36px;}</style>""", unsafe_allow_html=True)
|
| 142 |
+
threshold = st.slider("", 0.0, 1.0, 0.0, 0.05, label_visibility="hidden")
|
| 143 |
|
| 144 |
+
if detect or bool(threshold):
|
| 145 |
data, wcs = cut(data, wcs, scale=scale)
|
| 146 |
image = np.log10(data+1)
|
| 147 |
|
|
|
|
| 152 |
pred = np.rot90(pred, -j)
|
| 153 |
y_pred += pred / 4
|
| 154 |
|
| 155 |
+
y_pred = np.where(y_pred > threshold, y_pred, 0)
|
| 156 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
plot_prediction(y_pred)
|
| 158 |
|
| 159 |
with colC:
|