Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -86,14 +86,10 @@ def upload_image_and_get_url(image_path):
|
|
| 86 |
"""
|
| 87 |
TODO: Implement your image upload to public storage here.
|
| 88 |
For now, returns a placeholder URL.
|
| 89 |
-
Replace this with real upload logic that returns the actual URL for the image file passed.
|
| 90 |
"""
|
| 91 |
-
#
|
| 92 |
-
#
|
| 93 |
-
|
| 94 |
-
return "https://example.com/path/to/your/annotated_image.jpg"
|
| 95 |
-
else:
|
| 96 |
-
return "https://example.com/path/to/your/original_image.jpg"
|
| 97 |
|
| 98 |
def save_record_to_salesforce(annotated_image_url, coverage_percent, original_image_pil, compliance_threshold=80):
|
| 99 |
sf = Salesforce(
|
|
@@ -120,7 +116,7 @@ def save_record_to_salesforce(annotated_image_url, coverage_percent, original_im
|
|
| 120 |
'Name': record_name,
|
| 121 |
'Annotated_Image__c': annotated_image_url,
|
| 122 |
'Coverage_Percentage__c': round(coverage_percent, 2),
|
| 123 |
-
'Original_Image__c': original_image_url, #
|
| 124 |
'Compliance_Status__c': compliance_status,
|
| 125 |
'Technician_ID__c': technician_id,
|
| 126 |
'Verified_On__c': datetime.utcnow().isoformat()
|
|
|
|
| 86 |
"""
|
| 87 |
TODO: Implement your image upload to public storage here.
|
| 88 |
For now, returns a placeholder URL.
|
|
|
|
| 89 |
"""
|
| 90 |
+
# Example: upload to AWS S3, Azure Blob Storage, or other service
|
| 91 |
+
# Return the public URL to the uploaded image
|
| 92 |
+
return "https://example.com/path/to/your/annotated_image.jpg"
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
def save_record_to_salesforce(annotated_image_url, coverage_percent, original_image_pil, compliance_threshold=80):
|
| 95 |
sf = Salesforce(
|
|
|
|
| 116 |
'Name': record_name,
|
| 117 |
'Annotated_Image__c': annotated_image_url,
|
| 118 |
'Coverage_Percentage__c': round(coverage_percent, 2),
|
| 119 |
+
'Original_Image__c': original_image_url, # Correct field API name here
|
| 120 |
'Compliance_Status__c': compliance_status,
|
| 121 |
'Technician_ID__c': technician_id,
|
| 122 |
'Verified_On__c': datetime.utcnow().isoformat()
|