Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,9 @@ from astropy.nddata import Cutout2D, CCDData
|
|
14 |
from astropy.convolution import Gaussian2DKernel as Gauss
|
15 |
from astropy.convolution import convolve
|
16 |
|
|
|
|
|
|
|
17 |
# Streamlit
|
18 |
import streamlit as st
|
19 |
st.set_option('deprecation.showPyplotGlobalUse', False)
|
@@ -121,6 +124,7 @@ if uploaded_file is not None:
|
|
121 |
max_scale = int(data.shape[0] // 128)
|
122 |
scale = st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden")
|
123 |
scale = int(scale.split("x")[0]) // 128
|
|
|
124 |
|
125 |
with col3:
|
126 |
detect = st.button('Detect')
|
@@ -151,18 +155,18 @@ if uploaded_file is not None:
|
|
151 |
|
152 |
np.save("pred.npy", y_pred)
|
153 |
|
154 |
-
if
|
155 |
y_pred = np.load("pred.npy")
|
156 |
|
157 |
pred = np.where(y_pred > threshold, y_pred, 0)
|
158 |
|
159 |
-
|
160 |
|
161 |
-
with colC:
|
162 |
-
|
163 |
|
164 |
-
|
165 |
-
|
166 |
|
167 |
# ccd = CCDData(y_pred, unit="adu", wcs=wcs)
|
168 |
# ccd.write("predicted.fits", overwrite=True)
|
|
|
14 |
from astropy.convolution import Gaussian2DKernel as Gauss
|
15 |
from astropy.convolution import convolve
|
16 |
|
17 |
+
# Scikit-learn
|
18 |
+
from sklearn.cluster import DBSCAN
|
19 |
+
|
20 |
# Streamlit
|
21 |
import streamlit as st
|
22 |
st.set_option('deprecation.showPyplotGlobalUse', False)
|
|
|
124 |
max_scale = int(data.shape[0] // 128)
|
125 |
scale = st.selectbox('Scale:',[f"{(i+1)*128}x{(i+1)*128}" for i in range(max_scale)], label_visibility="hidden")
|
126 |
scale = int(scale.split("x")[0]) // 128
|
127 |
+
np.save("pred.npy", y_pred)
|
128 |
|
129 |
with col3:
|
130 |
detect = st.button('Detect')
|
|
|
155 |
|
156 |
np.save("pred.npy", y_pred)
|
157 |
|
158 |
+
if bool(threshold):
|
159 |
y_pred = np.load("pred.npy")
|
160 |
|
161 |
pred = np.where(y_pred > threshold, y_pred, 0)
|
162 |
|
163 |
+
plot_prediction(pred)
|
164 |
|
165 |
+
# with colC:
|
166 |
+
# st.markdown("""<style>[data-baseweb="select"] {margin-top: -36px;}</style>""", unsafe_allow_html=True)
|
167 |
|
168 |
+
# if decompose:
|
169 |
+
# cavs = decompose_cavity(y_pred)
|
170 |
|
171 |
# ccd = CCDData(y_pred, unit="adu", wcs=wcs)
|
172 |
# ccd.write("predicted.fits", overwrite=True)
|