Sanjayraju30 commited on
Commit
f32159a
Β·
verified Β·
1 Parent(s): 67da552

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
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 an image or capture from webcam. The app will extract the weight using OCR.")
16
 
17
- image_input = gr.Image(type="pil", label="πŸ“Έ Upload or Capture Image (Webcam works in some browsers)")
18
 
19
- btn = gr.Button("πŸš€ Detect Weight")
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
- btn.click(fn=process_image, inputs=image_input, outputs=[weight_out, time_out, snapshot_out])
 
 
 
 
 
 
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()