pragnakalp
commited on
Commit
•
c8cfd54
1
Parent(s):
799f3ce
Update app.py
Browse files
app.py
CHANGED
@@ -68,28 +68,28 @@ def ocr_with_easy(img):
|
|
68 |
Generate OCR
|
69 |
"""
|
70 |
def generate_ocr(Method,img):
|
71 |
-
try:
|
72 |
-
if img:
|
73 |
-
text_output = ''
|
74 |
-
add_csv = []
|
75 |
-
image_id = 1
|
76 |
-
print("Method___________________",Method)
|
77 |
-
if Method == 'EasyOCR':
|
78 |
-
text_output = ocr_with_easy(img)
|
79 |
-
if Method == 'KerasOCR':
|
80 |
-
text_output = ocr_with_keras(img)
|
81 |
-
if Method == 'PaddleOCR':
|
82 |
-
text_output = ocr_with_paddle(img)
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
|
89 |
-
except Exception as e:
|
90 |
-
|
91 |
-
|
92 |
-
return text_output
|
93 |
|
94 |
|
95 |
"""
|
|
|
68 |
Generate OCR
|
69 |
"""
|
70 |
def generate_ocr(Method,img):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
+
if img:
|
73 |
+
text_output = ''
|
74 |
+
add_csv = []
|
75 |
+
image_id = 1
|
76 |
+
print("Method___________________",Method)
|
77 |
+
if Method == 'EasyOCR':
|
78 |
+
text_output = ocr_with_easy(img)
|
79 |
+
if Method == 'KerasOCR':
|
80 |
+
text_output = ocr_with_keras(img)
|
81 |
+
if Method == 'PaddleOCR':
|
82 |
+
text_output = ocr_with_paddle(img)
|
83 |
+
|
84 |
+
flag(Method,text_output,img)
|
85 |
+
return text_output
|
86 |
+
else:
|
87 |
+
raise gr.Error("Please upload an image!!!!")
|
88 |
|
89 |
+
# except Exception as e:
|
90 |
+
# print("Error in ocr generation ==>",e)
|
91 |
+
# text_output = "Something went wrong"
|
92 |
+
# return text_output
|
93 |
|
94 |
|
95 |
"""
|