Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -3
src/streamlit_app.py
CHANGED
|
@@ -16,7 +16,7 @@ if "image_data" not in st.session_state:
|
|
| 16 |
if st.button("π Clear / Retake Photo"):
|
| 17 |
st.session_state.image_captured = False
|
| 18 |
st.session_state.image_data = None
|
| 19 |
-
st.
|
| 20 |
|
| 21 |
# β
Show camera only if no image captured
|
| 22 |
if not st.session_state.image_captured:
|
|
@@ -25,7 +25,7 @@ if not st.session_state.image_captured:
|
|
| 25 |
if img_data:
|
| 26 |
st.session_state.image_data = img_data
|
| 27 |
st.session_state.image_captured = True
|
| 28 |
-
st.
|
| 29 |
|
| 30 |
# β
If image is already captured
|
| 31 |
if st.session_state.image_captured and st.session_state.image_data:
|
|
@@ -50,7 +50,7 @@ if st.session_state.image_captured and st.session_state.image_data:
|
|
| 50 |
if st.button("π Retake Photo"):
|
| 51 |
st.session_state.image_captured = False
|
| 52 |
st.session_state.image_data = None
|
| 53 |
-
st.
|
| 54 |
st.stop()
|
| 55 |
|
| 56 |
st.success(f"β
Detected Weight: {weight} g (Confidence: {int(confidence)}%)")
|
|
|
|
| 16 |
if st.button("π Clear / Retake Photo"):
|
| 17 |
st.session_state.image_captured = False
|
| 18 |
st.session_state.image_data = None
|
| 19 |
+
st.rerun()
|
| 20 |
|
| 21 |
# β
Show camera only if no image captured
|
| 22 |
if not st.session_state.image_captured:
|
|
|
|
| 25 |
if img_data:
|
| 26 |
st.session_state.image_data = img_data
|
| 27 |
st.session_state.image_captured = True
|
| 28 |
+
st.rerun()
|
| 29 |
|
| 30 |
# β
If image is already captured
|
| 31 |
if st.session_state.image_captured and st.session_state.image_data:
|
|
|
|
| 50 |
if st.button("π Retake Photo"):
|
| 51 |
st.session_state.image_captured = False
|
| 52 |
st.session_state.image_data = None
|
| 53 |
+
st.rerun()
|
| 54 |
st.stop()
|
| 55 |
|
| 56 |
st.success(f"β
Detected Weight: {weight} g (Confidence: {int(confidence)}%)")
|