Update app.py
Browse files
app.py
CHANGED
@@ -154,7 +154,10 @@ def reset_threshold():
|
|
154 |
st.session_state['threshold'] = 0.0
|
155 |
# st.session_state['example'] = False
|
156 |
|
157 |
-
|
|
|
|
|
|
|
158 |
# Load model
|
159 |
model = load_CADET()
|
160 |
|
@@ -194,7 +197,7 @@ with col_1:
|
|
194 |
|
195 |
with col_2:
|
196 |
st.markdown("<br style='margin:15px 0'>", unsafe_allow_html=True)
|
197 |
-
example = st.button("Example",
|
198 |
|
199 |
# with col_2:
|
200 |
# st.markdown("### Examples")
|
@@ -219,7 +222,7 @@ if uploaded_file is not None:
|
|
219 |
MIN = np.min(np.where(data == 0, 1, data))
|
220 |
if MIN < 1: data = data / MIN
|
221 |
|
222 |
-
if st.session_state
|
223 |
fname = "NGC4649_example"
|
224 |
os.system(f'mkdir -p {fname}')
|
225 |
data, wcs = load_file(f"{fname}.fits")
|
|
|
154 |
st.session_state['threshold'] = 0.0
|
155 |
# st.session_state['example'] = False
|
156 |
|
157 |
+
#@st.cache #_data
|
158 |
+
def set_example():
|
159 |
+
st.session_state['example'] = True
|
160 |
+
|
161 |
# Load model
|
162 |
model = load_CADET()
|
163 |
|
|
|
197 |
|
198 |
with col_2:
|
199 |
st.markdown("<br style='margin:15px 0'>", unsafe_allow_html=True)
|
200 |
+
example = st.button("Example", on_click=set_example)
|
201 |
|
202 |
# with col_2:
|
203 |
# st.markdown("### Examples")
|
|
|
222 |
MIN = np.min(np.where(data == 0, 1, data))
|
223 |
if MIN < 1: data = data / MIN
|
224 |
|
225 |
+
if st.session_state["example"]:
|
226 |
fname = "NGC4649_example"
|
227 |
os.system(f'mkdir -p {fname}')
|
228 |
data, wcs = load_file(f"{fname}.fits")
|