Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -102,24 +102,23 @@ def process(input_type, file, lang):
|
|
102 |
return extracted_text
|
103 |
|
104 |
|
105 |
-
def generate_ocr(Method,img):
|
106 |
|
107 |
text_output = ''
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
raise gr.Error("Please upload an image!!!!")
|
123 |
|
124 |
"""
|
125 |
Create user interface for OCR demo
|
|
|
102 |
return extracted_text
|
103 |
|
104 |
|
105 |
+
def generate_ocr(Method, img):
|
106 |
|
107 |
text_output = ''
|
108 |
+
|
109 |
+
add_csv = []
|
110 |
+
image_id = 1
|
111 |
+
print("Method___________________",Method)
|
112 |
+
if Method == 'EasyOCR':
|
113 |
+
text_output = ocr_with_easy(img)
|
114 |
+
if Method == 'KerasOCR':
|
115 |
+
text_output = ocr_with_keras(img)
|
116 |
+
if Method == 'PaddleOCR':
|
117 |
+
text_output = ocr_with_paddle(img)
|
118 |
+
if Method == 'tesseract':
|
119 |
+
text_output = process("img", img, "fas")
|
120 |
+
return text_output
|
121 |
+
|
|
|
122 |
|
123 |
"""
|
124 |
Create user interface for OCR demo
|