Spaces:
Build error
Build error
Update app.py
Browse files
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 |
-
|
17 |
-
return f"{weight} g (Confidence: {confidence}%)", timestamp, image,
|
18 |
|
19 |
except Exception as e:
|
20 |
return f"Error: {str(e)}", "-", None, "-"
|
|
|
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, "-"
|