Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +19 -13
src/streamlit_app.py
CHANGED
|
@@ -199,21 +199,22 @@ if 'model' not in st.session_state:
|
|
| 199 |
st.session_state.which_pic=1
|
| 200 |
|
| 201 |
st.session_state.calculating=True
|
|
|
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
# Button to fetch a new image
|
| 206 |
-
col1, col2, col3 = st.columns([1,1,1])
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
|
| 216 |
-
|
| 217 |
|
| 218 |
|
| 219 |
# Display the current image
|
|
@@ -291,10 +292,15 @@ if st.session_state.label_input in ['cat', 'dog']:
|
|
| 291 |
st.info(f"You clicked on last picture (picture {st.session_state.which_pic}): {label_input}")
|
| 292 |
st.session_state.which_pic=st.session_state.which_pic+1
|
| 293 |
|
| 294 |
-
st.session_state.
|
| 295 |
-
refresh_start()
|
| 296 |
-
|
| 297 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
|
| 299 |
|
| 300 |
|
|
|
|
| 199 |
st.session_state.which_pic=1
|
| 200 |
|
| 201 |
st.session_state.calculating=True
|
| 202 |
+
st.session_state.next=True
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
# Button to fetch a new image
|
| 207 |
+
col1, col2, col3, col4 = st.columns([1,1,1,1])
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
with col1:
|
| 211 |
+
if st.button("Start",disabled=st.session_state.started):
|
| 212 |
+
if not st.session_state.started:
|
| 213 |
+
fetch_image()
|
| 214 |
+
st.session_state.started=True
|
| 215 |
+
st.session_state.calculating=False
|
| 216 |
|
| 217 |
+
|
| 218 |
|
| 219 |
|
| 220 |
# Display the current image
|
|
|
|
| 292 |
st.info(f"You clicked on last picture (picture {st.session_state.which_pic}): {label_input}")
|
| 293 |
st.session_state.which_pic=st.session_state.which_pic+1
|
| 294 |
|
| 295 |
+
st.session_state.next=False
|
|
|
|
|
|
|
| 296 |
|
| 297 |
+
|
| 298 |
+
with col4:
|
| 299 |
+
if st.button("next",disabled=st.session_state.next):
|
| 300 |
+
if not st.session_state.next:
|
| 301 |
+
fetch_image()
|
| 302 |
+
st.session_state.next=True
|
| 303 |
+
st.session_state.calculating=False
|
| 304 |
|
| 305 |
|
| 306 |
|