Sanjayraju30 commited on
Commit
b61209f
Β·
verified Β·
1 Parent(s): 33c8720

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -18,14 +18,14 @@ def process_image(image):
18
  with gr.Blocks(css=".gr-button {background-color: #2e7d32 !important; color: white !important;}") as demo:
19
  gr.Markdown("""
20
  <h1 style='text-align: center; color: #2e7d32;'>πŸ“· Auto Weight Logger</h1>
21
- <p style='text-align: center;'>AI-powered OCR tool to detect weights (kg or grams) from digital balance display images.</p>
22
  <hr style='border: 1px solid #ddd;'/>
23
  """)
24
 
25
  with gr.Row():
26
- image_input = gr.Image(type="pil", label="πŸ“ Upload or Capture Image", elem_id="img_upload")
27
 
28
- detect_btn = gr.Button("πŸš€ Detect Weight", elem_id="detect_btn")
29
 
30
  with gr.Row():
31
  weight_out = gr.Textbox(label="πŸ“¦ Detected Weight", placeholder="e.g., 72.4 kg", show_copy_button=True)
@@ -36,5 +36,8 @@ with gr.Blocks(css=".gr-button {background-color: #2e7d32 !important; color: whi
36
  detect_btn.click(fn=process_image, inputs=image_input, outputs=[weight_out, time_out, snapshot])
37
 
38
  gr.Markdown("""
39
- <br><p style='text-align: center; color: gray;'>Developed by Shalu | Powered by Hugging Face OCR πŸš€</p>
40
  """)
 
 
 
 
18
  with gr.Blocks(css=".gr-button {background-color: #2e7d32 !important; color: white !important;}") as demo:
19
  gr.Markdown("""
20
  <h1 style='text-align: center; color: #2e7d32;'>πŸ“· Auto Weight Logger</h1>
21
+ <p style='text-align: center;'>Detect weights (kg or grams) from digital balance display using AI OCR.</p>
22
  <hr style='border: 1px solid #ddd;'/>
23
  """)
24
 
25
  with gr.Row():
26
+ image_input = gr.Image(type="pil", label="πŸ“ Upload or Capture Image")
27
 
28
+ detect_btn = gr.Button("πŸš€ Detect Weight")
29
 
30
  with gr.Row():
31
  weight_out = gr.Textbox(label="πŸ“¦ Detected Weight", placeholder="e.g., 72.4 kg", show_copy_button=True)
 
36
  detect_btn.click(fn=process_image, inputs=image_input, outputs=[weight_out, time_out, snapshot])
37
 
38
  gr.Markdown("""
39
+ <br><p style='text-align: center; color: gray;'>Developed by Shalu β€’ Powered by Hugging Face OCR πŸš€</p>
40
  """)
41
+
42
+ # 🚨 REQUIRED for Hugging Face to recognize the app
43
+ demo.launch()