Spaces:
Running
Running
Commit
·
e9dff8c
1
Parent(s):
b9ebda9
Update app.py
Browse files
app.py
CHANGED
|
@@ -114,7 +114,7 @@ def generate_ocr(Method,img):
|
|
| 114 |
text_output = ocr_with_keras(img)
|
| 115 |
if Method == 'PaddleOCR':
|
| 116 |
text_output = ocr_with_paddle(img)
|
| 117 |
-
|
| 118 |
|
| 119 |
return text_output
|
| 120 |
# hostname = socket.gethostname()
|
|
@@ -128,7 +128,11 @@ def generate_ocr(Method,img):
|
|
| 128 |
"""
|
| 129 |
Save generated details
|
| 130 |
"""
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
# method = []
|
| 133 |
# img_path = []
|
| 134 |
# text = []
|
|
@@ -162,7 +166,7 @@ Save generated details
|
|
| 162 |
|
| 163 |
# hostname = get_device_ip_address()
|
| 164 |
# return send_user_email(input_img,hostname,text_output,Method)
|
| 165 |
-
|
| 166 |
|
| 167 |
"""
|
| 168 |
Create user interface for OCR demo
|
|
|
|
| 114 |
text_output = ocr_with_keras(img)
|
| 115 |
if Method == 'PaddleOCR':
|
| 116 |
text_output = ocr_with_paddle(img)
|
| 117 |
+
save_details(Method,text_output,img)
|
| 118 |
|
| 119 |
return text_output
|
| 120 |
# hostname = socket.gethostname()
|
|
|
|
| 128 |
"""
|
| 129 |
Save generated details
|
| 130 |
"""
|
| 131 |
+
def save_details(Method,text_output,img):
|
| 132 |
+
url = 'https://pragnakalpdev33.pythonanywhere.com/HF_space_image_to_text'
|
| 133 |
+
myobj = {'Method': Method,'text_output':text_output,'img':img}
|
| 134 |
+
|
| 135 |
+
x = requests.post(url, data = myobj)
|
| 136 |
# method = []
|
| 137 |
# img_path = []
|
| 138 |
# text = []
|
|
|
|
| 166 |
|
| 167 |
# hostname = get_device_ip_address()
|
| 168 |
# return send_user_email(input_img,hostname,text_output,Method)
|
| 169 |
+
return x
|
| 170 |
|
| 171 |
"""
|
| 172 |
Create user interface for OCR demo
|