Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from ocr_engine import extract_weight
|
|
6 |
|
7 |
def process_image(image):
|
8 |
if image is None:
|
9 |
-
return "No image provided", "", None, gr.update(visible=True)
|
10 |
try:
|
11 |
weight = extract_weight(image)
|
12 |
ist = pytz.timezone('Asia/Kolkata')
|
@@ -22,7 +22,7 @@ def process_image(image):
|
|
22 |
with gr.Blocks(css=".gr-button {background-color: #2e7d32 !important; color: white !important;}") as demo:
|
23 |
gr.Markdown("""
|
24 |
<h1 style='text-align: center; color: #2e7d32;'>📷 Auto Weight Logger</h1>
|
25 |
-
<p style='text-align: center;'>Upload or capture a digital weight image. Detects weight
|
26 |
<hr style='border: 1px solid #ddd;'/>
|
27 |
""")
|
28 |
|
@@ -43,7 +43,7 @@ with gr.Blocks(css=".gr-button {background-color: #2e7d32 !important; color: whi
|
|
43 |
inputs=[], outputs=[weight_out, time_out, snapshot, retake_btn])
|
44 |
|
45 |
gr.Markdown("""
|
46 |
-
<p style='text-align: center; color: gray;'>Tip: Ensure image is clear and
|
47 |
""")
|
48 |
|
49 |
demo.launch()
|
|
|
6 |
|
7 |
def process_image(image):
|
8 |
if image is None:
|
9 |
+
return "❌ No image provided", "", None, gr.update(visible=True)
|
10 |
try:
|
11 |
weight = extract_weight(image)
|
12 |
ist = pytz.timezone('Asia/Kolkata')
|
|
|
22 |
with gr.Blocks(css=".gr-button {background-color: #2e7d32 !important; color: white !important;}") as demo:
|
23 |
gr.Markdown("""
|
24 |
<h1 style='text-align: center; color: #2e7d32;'>📷 Auto Weight Logger</h1>
|
25 |
+
<p style='text-align: center;'>Upload or capture a digital weight image. Detects weight using OCR.</p>
|
26 |
<hr style='border: 1px solid #ddd;'/>
|
27 |
""")
|
28 |
|
|
|
43 |
inputs=[], outputs=[weight_out, time_out, snapshot, retake_btn])
|
44 |
|
45 |
gr.Markdown("""
|
46 |
+
<p style='text-align: center; color: gray;'>Tip: Ensure the image is clear and not blurry.<br>Developed by Shalu • Hugging Face OCR ⚡</p>
|
47 |
""")
|
48 |
|
49 |
demo.launch()
|