Spaces:
Running
Running
pragnakalp
commited on
Commit
•
f6127e6
1
Parent(s):
8b658d9
Update app.py
Browse files
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 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
s.
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
|
|
|
|
|
|
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:
|