未验证 提交 1bf6862d 编写于 作者: X xiaoting 提交者: GitHub

Merge pull request #948 from tink2123/fix_max_wh

fix max_wh_ratio for predict
......@@ -63,8 +63,9 @@ class TextRecognizer(object):
def resize_norm_img(self, img, max_wh_ratio):
imgC, imgH, imgW = self.rec_image_shape
assert imgC == img.shape[2]
wh_ratio = max(max_wh_ratio, imgW * 1.0 / imgH)
if self.character_type == "ch":
imgW = int((32 * max_wh_ratio))
imgW = int((32 * wh_ratio))
h, w = img.shape[:2]
ratio = w / float(h)
if math.ceil(imgH * ratio) > imgW:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册