Auto-weight-logger / src /streamlit_app.py
Sanjayraju30's picture
Update src/streamlit_app.py
aba4a6b verified
raw
history blame contribute delete
530 Bytes
import streamlit as st
from PIL import Image
from ocr_engine import extract_weight_from_image
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:
image = Image.open(img_data)
st.image(image, caption="πŸ“Έ Snapshot", use_column_width=True)
with st.spinner("Extracting weight..."):
weight = extract_weight_from_image(image)
st.success(f"βœ… Detected Weight: {weight} g")