Auto-weight-logger / streamlit_app.py
Sanjayraju30's picture
Rename app.py to streamlit_app.py
cbbdb0c verified
raw
history blame
513 Bytes
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: " + str(weight) + " g")