Update app.py
Browse files
app.py
CHANGED
|
@@ -81,7 +81,7 @@ def cut(data0, wcs0, scale=1):
|
|
| 81 |
return data, wcs
|
| 82 |
|
| 83 |
# Define function to apply cutting and produce a prediction
|
| 84 |
-
@st.cache
|
| 85 |
def cut_n_predict(data, wcs, scale):
|
| 86 |
data, wcs = cut(data, wcs, scale=scale)
|
| 87 |
image = np.log10(data+1)
|
|
@@ -96,7 +96,7 @@ def cut_n_predict(data, wcs, scale):
|
|
| 96 |
return y_pred, wcs
|
| 97 |
|
| 98 |
# Define function to decompose prediction into individual cavities
|
| 99 |
-
@st.cache
|
| 100 |
def decompose_cavity(pred, th2=0.7, amin=6):
|
| 101 |
X, Y = pred.nonzero()
|
| 102 |
data = np.array([X,Y]).reshape(2, -1)
|
|
@@ -135,7 +135,7 @@ def decompose_cavity(pred, th2=0.7, amin=6):
|
|
| 135 |
|
| 136 |
return image_decomposed
|
| 137 |
|
| 138 |
-
@st.cache
|
| 139 |
def load_file(fname):
|
| 140 |
with fits.open(fname) as hdul:
|
| 141 |
data = hdul[0].data
|
|
|
|
| 81 |
return data, wcs
|
| 82 |
|
| 83 |
# Define function to apply cutting and produce a prediction
|
| 84 |
+
# @st.cache
|
| 85 |
def cut_n_predict(data, wcs, scale):
|
| 86 |
data, wcs = cut(data, wcs, scale=scale)
|
| 87 |
image = np.log10(data+1)
|
|
|
|
| 96 |
return y_pred, wcs
|
| 97 |
|
| 98 |
# Define function to decompose prediction into individual cavities
|
| 99 |
+
# @st.cache
|
| 100 |
def decompose_cavity(pred, th2=0.7, amin=6):
|
| 101 |
X, Y = pred.nonzero()
|
| 102 |
data = np.array([X,Y]).reshape(2, -1)
|
|
|
|
| 135 |
|
| 136 |
return image_decomposed
|
| 137 |
|
| 138 |
+
# @st.cache
|
| 139 |
def load_file(fname):
|
| 140 |
with fits.open(fname) as hdul:
|
| 141 |
data = hdul[0].data
|