Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,15 +12,18 @@ def process_image(image):
|
|
| 12 |
|
| 13 |
with gr.Blocks() as demo:
|
| 14 |
gr.Markdown("## π· Auto Weight Logger β OCR-Based Smart Scale Reader")
|
| 15 |
-
gr.Markdown("Upload
|
| 16 |
|
| 17 |
-
image_input = gr.Image(type="pil", label="
|
| 18 |
|
| 19 |
-
|
| 20 |
-
weight_out = gr.Textbox(label="Detected Weight")
|
| 21 |
-
time_out = gr.Textbox(label="Captured At (IST)")
|
| 22 |
-
snapshot_out = gr.Image(label="Snapshot")
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
demo.launch()
|
|
|
|
| 12 |
|
| 13 |
with gr.Blocks() as demo:
|
| 14 |
gr.Markdown("## π· Auto Weight Logger β OCR-Based Smart Scale Reader")
|
| 15 |
+
gr.Markdown("Upload or capture a digital scale snapshot. This app detects the weight using OCR.")
|
| 16 |
|
| 17 |
+
image_input = gr.Image(type="pil", label="π Upload or Capture Image")
|
| 18 |
|
| 19 |
+
detect_btn = gr.Button("π Detect Weight")
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
with gr.Row():
|
| 22 |
+
weight_out = gr.Textbox(label="Detected Weight")
|
| 23 |
+
time_out = gr.Textbox(label="Captured At (IST)")
|
| 24 |
+
|
| 25 |
+
snapshot = gr.Image(label="Snapshot")
|
| 26 |
+
|
| 27 |
+
detect_btn.click(fn=process_image, inputs=image_input, outputs=[weight_out, time_out, snapshot])
|
| 28 |
|
| 29 |
demo.launch()
|