mohammad2928git commited on
Commit
48c697a
·
verified ·
1 Parent(s): 267fafa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -48,7 +48,7 @@ Paddle OCR
48
  """
49
  def ocr_with_paddle(img):
50
  finaltext = ''
51
- ocr = PaddleOCR(lang='en', use_angle_cls=True)
52
  # img_path = 'exp.jpeg'
53
  result = ocr.ocr(img)
54
 
@@ -84,7 +84,7 @@ def ocr_with_easy(img):
84
  gray_scale_image=get_grayscale(img)
85
  thresholding(gray_scale_image)
86
  cv2.imwrite('image.png',gray_scale_image)
87
- reader = easyocr.Reader(['th','en'])
88
  bounds = reader.readtext('image.png',paragraph="False",detail = 0)
89
  bounds = ''.join(bounds)
90
  return bounds
@@ -126,7 +126,7 @@ Create user interface for OCR demo
126
 
127
  # image = gr.Image(shape=(300, 300))
128
  image = gr.File(label="Upload PDF/Image")
129
- method = gr.Radio(["PaddleOCR","EasyOCR", "KerasOCR", "tesseract"],value="PaddleOCR")
130
  output = gr.Textbox(label="Output")
131
 
132
  demo = gr.Interface(
 
48
  """
49
  def ocr_with_paddle(img):
50
  finaltext = ''
51
+ ocr = PaddleOCR(lang='fa', use_angle_cls=True)
52
  # img_path = 'exp.jpeg'
53
  result = ocr.ocr(img)
54
 
 
84
  gray_scale_image=get_grayscale(img)
85
  thresholding(gray_scale_image)
86
  cv2.imwrite('image.png',gray_scale_image)
87
+ reader = easyocr.Reader(['fa','en'])
88
  bounds = reader.readtext('image.png',paragraph="False",detail = 0)
89
  bounds = ''.join(bounds)
90
  return bounds
 
126
 
127
  # image = gr.Image(shape=(300, 300))
128
  image = gr.File(label="Upload PDF/Image")
129
+ method = gr.Radio(["PaddleOCR","EasyOCR", "tesseract"],value="PaddleOCR")
130
  output = gr.Textbox(label="Output")
131
 
132
  demo = gr.Interface(