Spaces:
Running
Running
Update app.py
Browse files
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;'>
|
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,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
|
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()
|