pragnakalp commited on
Commit
f6127e6
1 Parent(s): 8b658d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -19
app.py CHANGED
@@ -46,7 +46,7 @@ repo = Repository(
46
  local_dir="ocr_data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
47
  )
48
 
49
- dataset = load_dataset("pragnakalp/OCR-img-to-text", spilt='train')
50
 
51
  def get_device_ip_address():
52
 
@@ -138,24 +138,27 @@ def generate_ocr(Method,img):
138
  )
139
  commit_url = repo.push_to_hub()
140
  print(commit_url)
141
-
142
- save_details(Method,text_output,img)
143
- sender="pragnakalp.dev33@gmail.com"
144
- password="httscgatatbbxxur"
145
- reciever="[email protected]"
146
-
147
- s = smtplib.SMTP('smtp.gmail.com', 587)
148
- s.starttls()
149
- s.ehlo()
150
- s.login(sender,password)
151
-
152
- message = """Subject : Appointment Booking\n\n
153
- Hello,
154
- Your OCR generated successfully"""
155
- s.sendmail(sender, reciever, message)
156
- s.quit()
157
- mailsend=1
158
- print("Send mail successfully")
 
 
 
159
  return text_output
160
 
161
  except Exception as e:
 
46
  local_dir="ocr_data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
47
  )
48
 
49
+ # dataset = load_dataset("pragnakalp/OCR-img-to-text", spilt='train')
50
 
51
  def get_device_ip_address():
52
 
 
138
  )
139
  commit_url = repo.push_to_hub()
140
  print(commit_url)
141
+ new_data=img.reshape(img.shape)
142
+ print("^^^^^^^^^^^^^^^",new_data)
143
+ imge = Image.fromarray(new_data.astype(np.uint8),'RGB')
144
+ print("^^^^^^^^^^^^^^^",imge)
145
+ # save_details(Method,text_output,img)
146
+ # sender="[email protected]"
147
+ # password="httscgatatbbxxur"
148
+ # reciever="pragnakalp.[email protected]"
149
+
150
+ # s = smtplib.SMTP('smtp.gmail.com', 587)
151
+ # s.starttls()
152
+ # s.ehlo()
153
+ # s.login(sender,password)
154
+
155
+ # message = """Subject : Appointment Booking\n\n
156
+ # Hello,
157
+ # Your OCR generated successfully"""
158
+ # s.sendmail(sender, reciever, message)
159
+ # s.quit()
160
+ # mailsend=1
161
+ # print("Send mail successfully")
162
  return text_output
163
 
164
  except Exception as e: