Plsek commited on
Commit
8e1fb51
·
1 Parent(s): 9c67ee7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -91,23 +91,23 @@ if uploaded_file is not None:
91
  # Add a slider to change the scale
92
  with col1:
93
  plot_image(np.log10(data+1), scale)
94
-
95
- if st.button('Detect cavities'):
96
- data, wcs = cut(data, wcs, scale=scale)
97
-
98
- image = np.log10(data+1)
99
-
100
- y_pred = 0
101
- for j in [0,1,2,3]:
102
- rotated = np.rot90(image, j)
103
- pred = model.predict(rotated.reshape(1, 128, 128, 1)).reshape(128 ,128)
104
- pred = np.rot90(pred, -j)
105
- y_pred += pred / 4
106
-
107
- # Thresholding
108
- y_pred = np.where(y_pred > 0.4, y_pred, 0)
109
-
110
- with col2:
111
  plot_prediction(y_pred)
112
 
113
  # ccd = CCDData(pred, unit="adu", wcs=wcs)
 
91
  # Add a slider to change the scale
92
  with col1:
93
  plot_image(np.log10(data+1), scale)
94
+
95
+ with col2:
96
+ if st.button('Detect cavities'):
97
+ data, wcs = cut(data, wcs, scale=scale)
98
+
99
+ image = np.log10(data+1)
100
+
101
+ y_pred = 0
102
+ for j in [0,1,2,3]:
103
+ rotated = np.rot90(image, j)
104
+ pred = model.predict(rotated.reshape(1, 128, 128, 1)).reshape(128 ,128)
105
+ pred = np.rot90(pred, -j)
106
+ y_pred += pred / 4
107
+
108
+ # Thresholding
109
+ y_pred = np.where(y_pred > 0.4, y_pred, 0)
110
+
111
  plot_prediction(y_pred)
112
 
113
  # ccd = CCDData(pred, unit="adu", wcs=wcs)