Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,9 @@ from ocr_engine import extract_weight
|
|
7 |
def process_image(image):
|
8 |
if image is None:
|
9 |
return "No image provided", "", None
|
10 |
-
|
11 |
try:
|
12 |
weight = extract_weight(image)
|
13 |
|
14 |
-
# Get IST time
|
15 |
ist = pytz.timezone('Asia/Kolkata')
|
16 |
now_ist = datetime.now(ist).strftime("%Y-%m-%d %H:%M:%S IST")
|
17 |
|
@@ -21,7 +19,7 @@ def process_image(image):
|
|
21 |
|
22 |
with gr.Blocks() as demo:
|
23 |
gr.Markdown("## π· Auto Weight Logger β Hugging Face OCR Edition")
|
24 |
-
gr.Markdown("Upload a digital weight image.
|
25 |
|
26 |
image_input = gr.Image(type="pil", label="π Upload or Capture Image")
|
27 |
detect_btn = gr.Button("π Detect Weight")
|
|
|
7 |
def process_image(image):
|
8 |
if image is None:
|
9 |
return "No image provided", "", None
|
|
|
10 |
try:
|
11 |
weight = extract_weight(image)
|
12 |
|
|
|
13 |
ist = pytz.timezone('Asia/Kolkata')
|
14 |
now_ist = datetime.now(ist).strftime("%Y-%m-%d %H:%M:%S IST")
|
15 |
|
|
|
19 |
|
20 |
with gr.Blocks() as demo:
|
21 |
gr.Markdown("## π· Auto Weight Logger β Hugging Face OCR Edition")
|
22 |
+
gr.Markdown("Upload a digital weight image. AI detects numeric value and unit (kg or grams).")
|
23 |
|
24 |
image_input = gr.Image(type="pil", label="π Upload or Capture Image")
|
25 |
detect_btn = gr.Button("π Detect Weight")
|