Sanjayraju30 commited on
Commit
8daea2b
·
verified ·
1 Parent(s): bd171b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -6,15 +6,15 @@ def process_image(image):
6
  try:
7
  if image is None:
8
  return "No image provided", "-", None, "-"
9
-
10
  weight, confidence = extract_weight_from_image(image)
11
  timestamp = get_ist_time()
12
 
13
  if not weight:
14
  return "No weight detected", timestamp, image, "-"
15
 
16
- log_url = f"https://your-salesforce-site.com/log-weight?weight={weight}&time={timestamp}"
17
- return f"{weight} g (Confidence: {confidence}%)", timestamp, image, log_url
18
 
19
  except Exception as e:
20
  return f"Error: {str(e)}", "-", None, "-"
@@ -29,7 +29,7 @@ iface = gr.Interface(
29
  gr.Textbox(label="Salesforce Log URL"),
30
  ],
31
  title="⚖️ Auto Weight Logger",
32
- description="Upload or capture a digital scale snapshot to detect weight automatically.",
33
  live=True,
34
  )
35
 
 
6
  try:
7
  if image is None:
8
  return "No image provided", "-", None, "-"
9
+
10
  weight, confidence = extract_weight_from_image(image)
11
  timestamp = get_ist_time()
12
 
13
  if not weight:
14
  return "No weight detected", timestamp, image, "-"
15
 
16
+ sf_url = f"https://your-salesforce-site.com/log-weight?weight={weight}&time={timestamp}"
17
+ return f"{weight} g (Confidence: {confidence}%)", timestamp, image, sf_url
18
 
19
  except Exception as e:
20
  return f"Error: {str(e)}", "-", None, "-"
 
29
  gr.Textbox(label="Salesforce Log URL"),
30
  ],
31
  title="⚖️ Auto Weight Logger",
32
+ description="Upload or capture a digital scale image to extract the weight.",
33
  live=True,
34
  )
35