hantech commited on
Commit
f3249f5
β€’
1 Parent(s): 6d4cdc0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -9,7 +9,6 @@ import easyocr
9
  import omegaconf
10
  import cv2
11
  import json
12
- from iftc.spelling_corrector import acronym_correction
13
 
14
  from vietocr.vietocr.tool.predictor import Predictor
15
  from vietocr.vietocr.tool.config import Cfg
@@ -87,9 +86,8 @@ def inference(filepath, lang, labels):
87
  cropped_image = img[min_y:max_y,min_x:max_x] # crop the image
88
  cropped_image = Image.fromarray(cropped_image)
89
  out = recognitor.predict(cropped_image)
90
- corrected_out = acronym_correction(out)
91
- print('correct from: '+ out + ' to: '+corrected_out)
92
- texts = texts + '\t' + corrected_out
93
  result = query(texts, labels)
94
  jsonText = json.dumps(result)
95
  im = PIL.Image.open(filepath)
 
9
  import omegaconf
10
  import cv2
11
  import json
 
12
 
13
  from vietocr.vietocr.tool.predictor import Predictor
14
  from vietocr.vietocr.tool.config import Cfg
 
86
  cropped_image = img[min_y:max_y,min_x:max_x] # crop the image
87
  cropped_image = Image.fromarray(cropped_image)
88
  out = recognitor.predict(cropped_image)
89
+
90
+ texts = texts + '\t' + out
 
91
  result = query(texts, labels)
92
  jsonText = json.dumps(result)
93
  im = PIL.Image.open(filepath)