Spaces:
Build error
Build error
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +7 -5
src/streamlit_app.py
CHANGED
|
@@ -8,8 +8,10 @@ st.title("⚖️ Auto Weight Logger")
|
|
| 8 |
img_data = st.camera_input("📷 Capture the weight display")
|
| 9 |
|
| 10 |
if img_data:
|
| 11 |
-
image = Image.open(img_data)
|
| 12 |
-
st.image(image, caption="📸 Snapshot", use_column_width=True)
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
| 8 |
img_data = st.camera_input("📷 Capture the weight display")
|
| 9 |
|
| 10 |
if img_data:
|
| 11 |
+
image = Image.open(img_data)
|
| 12 |
+
st.image(image, caption="📸 Snapshot", use_column_width=True)
|
| 13 |
+
|
| 14 |
+
with st.spinner("Extracting weight..."):
|
| 15 |
+
weight = extract_weight_from_image(image)
|
| 16 |
+
|
| 17 |
+
st.success(f"✅ Detected Weight: {weight} g")
|