Update app.py
Browse files
app.py
CHANGED
|
@@ -60,9 +60,9 @@ def plot_prediction(pred):
|
|
| 60 |
with colB: st.pyplot()
|
| 61 |
|
| 62 |
# Define function to plot the decomposed prediction
|
| 63 |
-
def plot_decomposed(
|
| 64 |
plt.figure(figsize=(4, 4))
|
| 65 |
-
plt.imshow(
|
| 66 |
plt.axis('off')
|
| 67 |
with colC: st.pyplot()
|
| 68 |
|
|
@@ -172,9 +172,6 @@ if uploaded_file is not None:
|
|
| 172 |
|
| 173 |
plot_prediction(y_pred)
|
| 174 |
|
| 175 |
-
# with colC:
|
| 176 |
-
# st.markdown("""<style>[data-baseweb="select"] {margin-top: -36px;}</style>""", unsafe_allow_html=True)
|
| 177 |
-
|
| 178 |
if decompose:
|
| 179 |
y_pred = np.load("thresh.npy")
|
| 180 |
|
|
@@ -188,7 +185,7 @@ if uploaded_file is not None:
|
|
| 188 |
ccd.write(f"predicted_{i+1}.fits", overwrite=True)
|
| 189 |
image_decomposed += (i+1) * np.where(cav > 0, 1, 0)
|
| 190 |
|
| 191 |
-
shutil.make_archive("predictions.zip", 'zip', "predictions")
|
| 192 |
np.save("decomposed.npy", image_decomposed)
|
| 193 |
|
| 194 |
try: image_decomposed = np.load("decomposed.npy")
|
|
|
|
| 60 |
with colB: st.pyplot()
|
| 61 |
|
| 62 |
# Define function to plot the decomposed prediction
|
| 63 |
+
def plot_decomposed(decomposed):
|
| 64 |
plt.figure(figsize=(4, 4))
|
| 65 |
+
plt.imshow(decomposed, origin="lower")
|
| 66 |
plt.axis('off')
|
| 67 |
with colC: st.pyplot()
|
| 68 |
|
|
|
|
| 172 |
|
| 173 |
plot_prediction(y_pred)
|
| 174 |
|
|
|
|
|
|
|
|
|
|
| 175 |
if decompose:
|
| 176 |
y_pred = np.load("thresh.npy")
|
| 177 |
|
|
|
|
| 185 |
ccd.write(f"predicted_{i+1}.fits", overwrite=True)
|
| 186 |
image_decomposed += (i+1) * np.where(cav > 0, 1, 0)
|
| 187 |
|
| 188 |
+
# shutil.make_archive("predictions.zip", 'zip', "predictions")
|
| 189 |
np.save("decomposed.npy", image_decomposed)
|
| 190 |
|
| 191 |
try: image_decomposed = np.load("decomposed.npy")
|