pavansuresh commited on
Commit
9d6c332
·
verified ·
1 Parent(s): 41ab2fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -86,10 +86,14 @@ 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
  """
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,7 +120,7 @@ def save_record_to_salesforce(annotated_image_url, coverage_percent, original_im
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()
 
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
+ # This function will be called twice: once for annotated image, once for original image
92
+ # To differentiate, you can check the filename or path or pass an additional param if you extend this
93
+ if "annotated" in image_path:
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
  '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, # Use correct API name field
124
  'Compliance_Status__c': compliance_status,
125
  'Technician_ID__c': technician_id,
126
  'Verified_On__c': datetime.utcnow().isoformat()