Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,6 +51,7 @@ _, row1_col1, _ = st.columns([2,3,2])
|
|
| 51 |
_, row2_col1, row2_col2, row2_col3, row2_col4, _ = st.columns([8,3,3,3,3,8])
|
| 52 |
_, row3_col1, row3_col2, row3_col3, row3_col4, _ = st.columns([8,3,3,3,3,8])
|
| 53 |
_, row4_col2, row4_col3, _ = st.columns([1,4,4,1], gap="medium")
|
|
|
|
| 54 |
|
| 55 |
|
| 56 |
|
|
@@ -212,23 +213,25 @@ if st.session_state.screen == 2:
|
|
| 212 |
st.image(st.session_state.image, use_column_width=True)
|
| 213 |
|
| 214 |
with row4_col3:
|
| 215 |
-
|
| 216 |
-
with
|
| 217 |
if st.button("Back"):
|
| 218 |
if st.session_state.image_counter > 0:
|
| 219 |
st.session_state.image_counter -= 1
|
| 220 |
-
with
|
| 221 |
if st.button("Select New Photo"):
|
| 222 |
st.session_state.screen = 1
|
| 223 |
st.session_state.results = None
|
| 224 |
st.rerun()
|
| 225 |
-
with
|
| 226 |
if st.button("Next"):
|
| 227 |
-
if st.session_state.image_counter < len(st.session_state.results
|
| 228 |
st.session_state.image_counter += 1
|
| 229 |
|
| 230 |
# predictions
|
| 231 |
if 'results' not in st.session_state:
|
|
|
|
|
|
|
| 232 |
st.session_state.results = st.session_state.model.predict(tiles, conf=0.5) # predict
|
| 233 |
|
| 234 |
# plot predicted image
|
|
|
|
| 51 |
_, row2_col1, row2_col2, row2_col3, row2_col4, _ = st.columns([8,3,3,3,3,8])
|
| 52 |
_, row3_col1, row3_col2, row3_col3, row3_col4, _ = st.columns([8,3,3,3,3,8])
|
| 53 |
_, row4_col2, row4_col3, _ = st.columns([1,4,4,1], gap="medium")
|
| 54 |
+
row4a_col0, row4a_col1, row4a_col2= st.columns([1,1,1], gap="medium")
|
| 55 |
|
| 56 |
|
| 57 |
|
|
|
|
| 213 |
st.image(st.session_state.image, use_column_width=True)
|
| 214 |
|
| 215 |
with row4_col3:
|
| 216 |
+
# navigation
|
| 217 |
+
with row4a_col0:
|
| 218 |
if st.button("Back"):
|
| 219 |
if st.session_state.image_counter > 0:
|
| 220 |
st.session_state.image_counter -= 1
|
| 221 |
+
with row4a_col1:
|
| 222 |
if st.button("Select New Photo"):
|
| 223 |
st.session_state.screen = 1
|
| 224 |
st.session_state.results = None
|
| 225 |
st.rerun()
|
| 226 |
+
with row4a_col2:
|
| 227 |
if st.button("Next"):
|
| 228 |
+
if st.session_state.image_counter < len(st.session_state.results - 1:
|
| 229 |
st.session_state.image_counter += 1
|
| 230 |
|
| 231 |
# predictions
|
| 232 |
if 'results' not in st.session_state:
|
| 233 |
+
st.write("The model is working. Please be patient...")
|
| 234 |
+
st.write("This process takes around 30 seconds.")
|
| 235 |
st.session_state.results = st.session_state.model.predict(tiles, conf=0.5) # predict
|
| 236 |
|
| 237 |
# plot predicted image
|