Spaces:
Sleeping
Sleeping
File size: 535 Bytes
fb1a823 216f81d fb1a823 7aa5221 00286f9 fb1a823 216f81d 00286f9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import streamlit as st
import cv2
import tempfile
from ocr_engine import extract_weight
st.set_page_config(page_title="Auto Weight Logger", layout="centered")
st.title("โ๏ธ Auto Weight Logger")
img_data = st.camera_input("๐ท Capture the weight display")
if img_data:
โwith tempfile.NamedTemporaryFile(delete=False, suffix=".jpg") as f:
โโf.write(img_data.getvalue())
โโf.flush()
โโweight = extract_weight(f.name)
โโst.image(f.name, caption="๐ธ Snapshot")
โโst.success(f"โ
Detected Weight: {weight} g") |