mohammad2928git commited on
Commit
267fafa
·
verified ·
1 Parent(s): 7fa16d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -16
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
- if (img).any():
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
- else:
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