Sanjayraju30 commited on
Commit
4f9e76a
Β·
verified Β·
1 Parent(s): 33069a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -12,17 +12,18 @@ def process_image(img):
12
  return f"{weight} g (Confidence: {confidence}%)", ist_time, img
13
 
14
  with gr.Blocks(title="βš–οΈ Auto Weight Logger") as demo:
15
- with gr.Column():
16
- gr.Markdown("## βš–οΈ Auto Weight Logger")
17
- image_input = gr.Image(type="pil", label="πŸ“· Upload or Capture Image")
18
 
19
- with gr.Row():
20
- output_weight = gr.Textbox(label="βš–οΈ Detected Weight")
21
- timestamp = gr.Textbox(label="πŸ•’ Captured At (IST)")
22
 
 
 
23
  snapshot = gr.Image(label="πŸ“Έ Snapshot Image")
24
 
25
- submit = gr.Button("πŸ” Detect Weight")
26
- submit.click(process_image, inputs=image_input, outputs=[output_weight, timestamp, snapshot])
27
 
28
  demo.launch()
 
12
  return f"{weight} g (Confidence: {confidence}%)", ist_time, img
13
 
14
  with gr.Blocks(title="βš–οΈ Auto Weight Logger") as demo:
15
+ gr.Markdown("# βš–οΈ Auto Weight Logger")
16
+ gr.Markdown("Upload or capture an image of the digital scale display to extract the weight using OCR.")
 
17
 
18
+ with gr.Row():
19
+ image_input = gr.Image(type="pil", label="πŸ“· Upload or Capture Image")
20
+ output_weight = gr.Textbox(label="βš–οΈ Detected Weight")
21
 
22
+ with gr.Row():
23
+ timestamp = gr.Textbox(label="πŸ•’ Captured At (IST)")
24
  snapshot = gr.Image(label="πŸ“Έ Snapshot Image")
25
 
26
+ submit = gr.Button("πŸ” Detect Weight")
27
+ submit.click(process_image, inputs=image_input, outputs=[output_weight, timestamp, snapshot])
28
 
29
  demo.launch()