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

rever 'limit maximum resizing ratio' (#9448)

上级 77b05c2a
...@@ -112,9 +112,8 @@ class ABINetRecAug(object): ...@@ -112,9 +112,8 @@ class ABINetRecAug(object):
scale=(0.5, 2.), scale=(0.5, 2.),
shear=(45, 15), shear=(45, 15),
distortion=0.5, distortion=0.5,
p=geometry_p), p=geometry_p), CVDeterioration(
CVDeterioration( var=20, degrees=6, factor=4, p=deterioration_p),
var=20, degrees=6, factor=4, p=deterioration_p),
CVColorJitter( CVColorJitter(
brightness=0.5, brightness=0.5,
contrast=0.5, contrast=0.5,
...@@ -188,9 +187,8 @@ class SVTRRecAug(object): ...@@ -188,9 +187,8 @@ class SVTRRecAug(object):
scale=(0.5, 2.), scale=(0.5, 2.),
shear=(45, 15), shear=(45, 15),
distortion=0.5, distortion=0.5,
p=geometry_p), p=geometry_p), SVTRDeterioration(
SVTRDeterioration( var=20, degrees=6, factor=4, p=deterioration_p),
var=20, degrees=6, factor=4, p=deterioration_p),
CVColorJitter( CVColorJitter(
brightness=0.5, brightness=0.5,
contrast=0.5, contrast=0.5,
...@@ -575,7 +573,7 @@ def resize_norm_img_chinese(img, image_shape): ...@@ -575,7 +573,7 @@ def resize_norm_img_chinese(img, image_shape):
max_wh_ratio = imgW * 1.0 / imgH max_wh_ratio = imgW * 1.0 / imgH
h, w = img.shape[0], img.shape[1] h, w = img.shape[0], img.shape[1]
ratio = w * 1.0 / h ratio = w * 1.0 / h
max_wh_ratio = min(max(max_wh_ratio, ratio), max_wh_ratio) max_wh_ratio = max(max_wh_ratio, ratio)
imgW = int(imgH * max_wh_ratio) imgW = int(imgH * max_wh_ratio)
if math.ceil(imgH * ratio) > imgW: if math.ceil(imgH * ratio) > imgW:
resized_w = imgW resized_w = imgW
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册