Update app.py
Browse files
app.py
CHANGED
|
@@ -78,7 +78,6 @@ if uploaded_file is not None:
|
|
| 78 |
with fits.open(uploaded_file) as hdul:
|
| 79 |
data = hdul[0].data
|
| 80 |
wcs = WCS(hdul[0].header)
|
| 81 |
-
image = np.log10(data+1)
|
| 82 |
|
| 83 |
# Add a slider to change the scale
|
| 84 |
with col1:
|
|
@@ -87,7 +86,7 @@ if uploaded_file is not None:
|
|
| 87 |
|
| 88 |
scale = st.selectbox('Scale:',[i for i in range(max_scale)])
|
| 89 |
|
| 90 |
-
plot_image(
|
| 91 |
|
| 92 |
with col2:
|
| 93 |
st.button('Detect cavities')
|
|
@@ -95,7 +94,7 @@ if uploaded_file is not None:
|
|
| 95 |
|
| 96 |
y_pred = 0
|
| 97 |
for j in [0,1,2,3]:
|
| 98 |
-
rotated = np.rot90(
|
| 99 |
pred = model.predict(rotated.reshape(1, 128, 128, 1)).reshape(128 ,128)
|
| 100 |
pred = np.rot90(pred, -j)
|
| 101 |
y_pred += pred / 4
|
|
|
|
| 78 |
with fits.open(uploaded_file) as hdul:
|
| 79 |
data = hdul[0].data
|
| 80 |
wcs = WCS(hdul[0].header)
|
|
|
|
| 81 |
|
| 82 |
# Add a slider to change the scale
|
| 83 |
with col1:
|
|
|
|
| 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')
|
|
|
|
| 94 |
|
| 95 |
y_pred = 0
|
| 96 |
for j in [0,1,2,3]:
|
| 97 |
+
rotated = np.rot90(np.log10(data+1), j)
|
| 98 |
pred = model.predict(rotated.reshape(1, 128, 128, 1)).reshape(128 ,128)
|
| 99 |
pred = np.rot90(pred, -j)
|
| 100 |
y_pred += pred / 4
|