Ajay98 commited on
Commit
cb50e70
·
verified ·
1 Parent(s): 5a58b54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -7,20 +7,20 @@ from email.mime.text import MIMEText
7
  from email.mime.multipart import MIMEMultipart
8
 
9
  # Salesforce credentials
10
- USERNAME = 'your_salesforce_username'
11
- PASSWORD = 'your_salesforce_password'
12
- SECURITY_TOKEN = 'your_salesforce_security_token'
13
 
14
  # Connect to Salesforce
15
  sf = Salesforce(username=USERNAME, password=PASSWORD, security_token=SECURITY_TOKEN)
16
 
17
  # Query records from two custom objects (with image fields)
18
- custom_object_1 = 'CustomObject1__c'
19
- custom_object_2 = 'CustomObject2__c'
20
 
21
  # Replace with actual field names
22
- query_1 = f"SELECT Id, Name, PhotoField__c FROM {custom_object_1}"
23
- query_2 = f"SELECT Id, Name, PhotoField__c FROM {custom_object_2}"
24
 
25
  # Retrieve records
26
  records_custom_object_1 = sf.query(query_1)['records']
@@ -31,9 +31,9 @@ salesforce_records = records_custom_object_1 + records_custom_object_2
31
 
32
  # Function to send an email if unknown face is found
33
  def send_email(unknown_image_path):
34
- sender_email = "your_email@gmail.com"
35
- receiver_email = "receiver_email@gmail.com"
36
- password = "your_email_password"
37
 
38
  message = MIMEMultipart("alternative")
39
  message["Subject"] = "Unknown Face Detected"
@@ -51,7 +51,7 @@ def send_email(unknown_image_path):
51
  server.sendmail(sender_email, receiver_email, message.as_string())
52
 
53
  # Folder with input images to match
54
- input_folder = "path_to_input_images_folder"
55
 
56
  # Function to compare images and find matches
57
  def compare_images(salesforce_records, input_folder):
 
7
  from email.mime.multipart import MIMEMultipart
8
 
9
  # Salesforce credentials
10
+ USERNAME = 'ajayalways411@gmail.com'
11
+ PASSWORD = 'Anusha@310819'
12
+ SECURITY_TOKEN = 'DcroeUKt0Lc4Lpqgzh9dMxEyQ'
13
 
14
  # Connect to Salesforce
15
  sf = Salesforce(username=USERNAME, password=PASSWORD, security_token=SECURITY_TOKEN)
16
 
17
  # Query records from two custom objects (with image fields)
18
+ custom_object_1 = 'CustomerData__c'
19
+ custom_object_2 = 'staff__c'
20
 
21
  # Replace with actual field names
22
+ query_1 = f"SELECT PhoneNumber__c, Name, AdhardCardPhoto__c FROM {custom_object_1}"
23
+ query_2 = f"SELECT contactNumber__c, Name, AdhardCard__c FROM {custom_object_2}"
24
 
25
  # Retrieve records
26
  records_custom_object_1 = sf.query(query_1)['records']
 
31
 
32
  # Function to send an email if unknown face is found
33
  def send_email(unknown_image_path):
34
+ sender_email = "aajayk999@gmail.com@gmail.com"
35
+ receiver_email = "ajayaklaram07@gmail.com"
36
+ password = "8008995817"
37
 
38
  message = MIMEMultipart("alternative")
39
  message["Subject"] = "Unknown Face Detected"
 
51
  server.sendmail(sender_email, receiver_email, message.as_string())
52
 
53
  # Folder with input images to match
54
+ input_folder = "C:\Users\nikit\OneDrive\Desktop\New folder (2)"
55
 
56
  # Function to compare images and find matches
57
  def compare_images(salesforce_records, input_folder):