Update app.py
Browse files
app.py
CHANGED
@@ -69,7 +69,6 @@ def cut(data0, wcs0, scale=1):
|
|
69 |
|
70 |
return data, wcs
|
71 |
|
72 |
-
|
73 |
# If file is uploaded, read in the data and plot it
|
74 |
if uploaded_file is not None:
|
75 |
col1.subheader("Input image")
|
@@ -84,17 +83,17 @@ if uploaded_file is not None:
|
|
84 |
max_scale = int(data.shape[0] // 128)
|
85 |
# scale = st.slider("Scale", 1, max_scale, 1, 1)
|
86 |
|
87 |
-
scale = st.selectbox('Scale:',[i for i in range(max_scale)])
|
88 |
|
89 |
plot_image(np.log10(data+1), scale)
|
90 |
|
91 |
with col2:
|
92 |
st.button('Detect cavities')
|
93 |
-
data, wcs = cut(data, wcs, scale=scale)
|
94 |
|
95 |
y_pred = 0
|
96 |
for j in [0,1,2,3]:
|
97 |
-
rotated = np.rot90(
|
98 |
pred = model.predict(rotated.reshape(1, 128, 128, 1)).reshape(128 ,128)
|
99 |
pred = np.rot90(pred, -j)
|
100 |
y_pred += pred / 4
|
|
|
69 |
|
70 |
return data, wcs
|
71 |
|
|
|
72 |
# If file is uploaded, read in the data and plot it
|
73 |
if uploaded_file is not None:
|
74 |
col1.subheader("Input image")
|
|
|
83 |
max_scale = int(data.shape[0] // 128)
|
84 |
# scale = st.slider("Scale", 1, max_scale, 1, 1)
|
85 |
|
86 |
+
scale = int(st.selectbox('Scale:',[i for i in range(max_scale)], label_visibility="hidden"))
|
87 |
|
88 |
plot_image(np.log10(data+1), scale)
|
89 |
|
90 |
with col2:
|
91 |
st.button('Detect cavities')
|
92 |
+
data, wcs = cut(np.log10(data+1), wcs, scale=scale)
|
93 |
|
94 |
y_pred = 0
|
95 |
for j in [0,1,2,3]:
|
96 |
+
rotated = np.rot90(, j)
|
97 |
pred = model.predict(rotated.reshape(1, 128, 128, 1)).reshape(128 ,128)
|
98 |
pred = np.rot90(pred, -j)
|
99 |
y_pred += pred / 4
|