WebashalarForML commited on
Commit
308366d
1 Parent(s): 12a3050

Update utility/utils.py

Browse files
Files changed (1) hide show
  1. utility/utils.py +7 -1
utility/utils.py CHANGED
@@ -112,7 +112,13 @@ def ocr_with_paddle(img):
112
  finaltext = ''
113
  #model_dir = os.getenv('PADDLEOCR_MODEL_DIR', '/tmp/.paddleocr')
114
  #ocr = PaddleOCR(lang='en', use_angle_cls=True, det_model_dir=model_dir)
115
- ocr = PaddleOCR(lang='en', use_angle_cls=True, det_model_dir=os.environ['PADDLEOCR_HOME'])
 
 
 
 
 
 
116
 
117
  result = ocr.ocr(img)
118
 
 
112
  finaltext = ''
113
  #model_dir = os.getenv('PADDLEOCR_MODEL_DIR', '/tmp/.paddleocr')
114
  #ocr = PaddleOCR(lang='en', use_angle_cls=True, det_model_dir=model_dir)
115
+ #ocr = PaddleOCR(lang='en', use_angle_cls=True, det_model_dir=os.environ['PADDLEOCR_HOME'])
116
+ ocr = PaddleOCR(
117
+ lang='en',
118
+ use_angle_cls=True,
119
+ rec_model_dir=os.path.join(os.environ['PADDLEOCR_HOME'], 'whl/rec/en/en_PP-OCRv4_rec_infer'),
120
+ det_model_dir=os.path.join(os.environ['PADDLEOCR_HOME'], 'whl/det')
121
+ )
122
 
123
  result = ocr.ocr(img)
124