Sanjayraju30 commited on
Commit
0f4e1bf
Β·
verified Β·
1 Parent(s): d4534d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 f"{weight} grams", 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. Detects weight using a transformer-based OCR model.")
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