Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,13 +10,13 @@ def process_image(image):
|
|
10 |
try:
|
11 |
weight = extract_weight(image)
|
12 |
timestamp = datetime.now().astimezone().strftime("%Y-%m-%d %H:%M:%S %Z")
|
13 |
-
return
|
14 |
except Exception as e:
|
15 |
return f"Error: {str(e)}", "", None
|
16 |
|
17 |
with gr.Blocks() as demo:
|
18 |
gr.Markdown("## π· Auto Weight Logger β Hugging Face OCR Edition")
|
19 |
-
gr.Markdown("Upload a digital scale image.
|
20 |
|
21 |
image_input = gr.Image(type="pil", label="π Upload or Capture Image")
|
22 |
|
|
|
10 |
try:
|
11 |
weight = extract_weight(image)
|
12 |
timestamp = datetime.now().astimezone().strftime("%Y-%m-%d %H:%M:%S %Z")
|
13 |
+
return weight, timestamp, image
|
14 |
except Exception as e:
|
15 |
return f"Error: {str(e)}", "", None
|
16 |
|
17 |
with gr.Blocks() as demo:
|
18 |
gr.Markdown("## π· Auto Weight Logger β Hugging Face OCR Edition")
|
19 |
+
gr.Markdown("Upload a digital scale image. This app detects the weight (kg or g) using AI.")
|
20 |
|
21 |
image_input = gr.Image(type="pil", label="π Upload or Capture Image")
|
22 |
|