Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -75,9 +75,10 @@ def save_to_salesforce(weight_text, img_base64):
|
|
75 |
|
76 |
record = {
|
77 |
"Name": f"Weight_Log_{ist_time}",
|
78 |
-
"
|
79 |
-
"
|
80 |
-
"
|
|
|
81 |
}
|
82 |
result = sf.Weight_Log__c.create(record)
|
83 |
logging.info(f"Salesforce record created: {result}")
|
@@ -91,7 +92,7 @@ with gr.Blocks(title="⚖️ Auto Weight Logger") as demo:
|
|
91 |
gr.Markdown("📷 Upload or capture an image of a digital weight scale (max 5MB).")
|
92 |
|
93 |
with gr.Row():
|
94 |
-
image_input = gr.Image(type="pil", label="Upload / Capture Image")
|
95 |
output_weight = gr.Textbox(label="⚖️ Detected Weight (in kg)")
|
96 |
|
97 |
with gr.Row():
|
|
|
75 |
|
76 |
record = {
|
77 |
"Name": f"Weight_Log_{ist_time}",
|
78 |
+
"Captured_Weight__c": weight,
|
79 |
+
"Captured_At__c": ist_time,
|
80 |
+
"Snapshot_Image__c": img_base64,
|
81 |
+
"Status__c": "Confirmed"
|
82 |
}
|
83 |
result = sf.Weight_Log__c.create(record)
|
84 |
logging.info(f"Salesforce record created: {result}")
|
|
|
92 |
gr.Markdown("📷 Upload or capture an image of a digital weight scale (max 5MB).")
|
93 |
|
94 |
with gr.Row():
|
95 |
+
image_input = gr.Image(type="pil", label="Upload / Capture Image", sources=["upload", "webcam"])
|
96 |
output_weight = gr.Textbox(label="⚖️ Detected Weight (in kg)")
|
97 |
|
98 |
with gr.Row():
|