Update src/streamlit_app.py
Browse files- src/streamlit_app.py +2 -2
src/streamlit_app.py
CHANGED
@@ -8,7 +8,7 @@ st.title("βοΈ Auto Weight Logger")
|
|
8 |
|
9 |
img_data = st.camera_input("π· Capture the weight display")
|
10 |
|
11 |
-
if img_data:
|
12 |
if len(img_data.getvalue()) > 5 * 1024 * 1024:
|
13 |
st.error("β Image too large (>5MB). Please try again.")
|
14 |
st.stop()
|
@@ -19,7 +19,7 @@ if img_data:
|
|
19 |
with st.spinner("π Extracting weight..."):
|
20 |
weight, confidence = extract_weight_from_image(image)
|
21 |
|
22 |
-
#
|
23 |
st.write(f"π οΈ DEBUG: weight = {weight}, confidence = {confidence}")
|
24 |
|
25 |
if not weight or confidence < 80:
|
|
|
8 |
|
9 |
img_data = st.camera_input("π· Capture the weight display")
|
10 |
|
11 |
+
if img_data is not None:
|
12 |
if len(img_data.getvalue()) > 5 * 1024 * 1024:
|
13 |
st.error("β Image too large (>5MB). Please try again.")
|
14 |
st.stop()
|
|
|
19 |
with st.spinner("π Extracting weight..."):
|
20 |
weight, confidence = extract_weight_from_image(image)
|
21 |
|
22 |
+
# DEBUG: This helps you test OCR output
|
23 |
st.write(f"π οΈ DEBUG: weight = {weight}, confidence = {confidence}")
|
24 |
|
25 |
if not weight or confidence < 80:
|