add ocr_recognition bugfix

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/11785977
This commit is contained in:
yuanzhi.zyz
2023-02-24 17:02:24 +08:00
committed by wenmeng.zwm
parent 8411645524
commit eca75bc6af

View File

@@ -1,5 +1,6 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
import math
import os
import cv2
@@ -71,6 +72,8 @@ class OCRRecognitionPreprocessor(Preprocessor):
)
if self.do_chunking:
PRED_LENTH = 75
PRED_PAD = 6
data = []
img_h, img_w = img.shape
wh_ratio = img_w / img_h