Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,13 +104,13 @@ def generate_ocr(Method, img):
|
|
| 104 |
add_csv = []
|
| 105 |
image_id = 1
|
| 106 |
print("Method___________________",Method)
|
| 107 |
-
if Method == '
|
| 108 |
text_output = ocr_with_easy(img)
|
| 109 |
if Method == 'KerasOCR':
|
| 110 |
text_output = ocr_with_keras(img)
|
| 111 |
-
if Method == '
|
| 112 |
text_output = ocr_with_paddle(img)
|
| 113 |
-
if Method == '
|
| 114 |
text_output = process("img", img, "fas")
|
| 115 |
return text_output
|
| 116 |
|
|
@@ -122,7 +122,7 @@ Create user interface for OCR demo
|
|
| 122 |
# image = gr.Image(shape=(300, 300))
|
| 123 |
# image = gr.File(label="Upload PDF/Image")
|
| 124 |
image = gr.Image()
|
| 125 |
-
method = gr.Radio(["
|
| 126 |
output = gr.Textbox(label="Output")
|
| 127 |
|
| 128 |
demo = gr.Interface(
|
|
|
|
| 104 |
add_csv = []
|
| 105 |
image_id = 1
|
| 106 |
print("Method___________________",Method)
|
| 107 |
+
if Method == 'Version2':
|
| 108 |
text_output = ocr_with_easy(img)
|
| 109 |
if Method == 'KerasOCR':
|
| 110 |
text_output = ocr_with_keras(img)
|
| 111 |
+
if Method == 'Version1':
|
| 112 |
text_output = ocr_with_paddle(img)
|
| 113 |
+
if Method == 'Version3':
|
| 114 |
text_output = process("img", img, "fas")
|
| 115 |
return text_output
|
| 116 |
|
|
|
|
| 122 |
# image = gr.Image(shape=(300, 300))
|
| 123 |
# image = gr.File(label="Upload PDF/Image")
|
| 124 |
image = gr.Image()
|
| 125 |
+
method = gr.Radio(["Version1","Version2", "Version3"],value="PaddleOCR")
|
| 126 |
output = gr.Textbox(label="Output")
|
| 127 |
|
| 128 |
demo = gr.Interface(
|