mohammad2928git commited on
Commit
90da558
·
verified ·
1 Parent(s): cbb5807

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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 == 'EasyOCR':
108
  text_output = ocr_with_easy(img)
109
  if Method == 'KerasOCR':
110
  text_output = ocr_with_keras(img)
111
- if Method == 'PaddleOCR':
112
  text_output = ocr_with_paddle(img)
113
- if Method == 'tesseract':
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(["PaddleOCR","EasyOCR", "tesseract"],value="PaddleOCR")
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(