From 72d91eab11cf286d72fa44c70212260c2ac46c32 Mon Sep 17 00:00:00 2001 From: topduke <784990967@qq.com> Date: Tue, 14 Feb 2023 16:04:19 +0800 Subject: [PATCH] update Blur to fix training time consumption (#9068) * fix piecewise boundaries and droppath dtype * fix tipc piecewise boundaries and droppath dtype * update Blur to fix training time consumption --- ppocr/data/imaug/rec_img_aug.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ppocr/data/imaug/rec_img_aug.py b/ppocr/data/imaug/rec_img_aug.py index 48404ab8..c8883cb3 100644 --- a/ppocr/data/imaug/rec_img_aug.py +++ b/ppocr/data/imaug/rec_img_aug.py @@ -69,6 +69,8 @@ class BaseDataAugmentation(object): self.jitter_prob = jitter_prob self.blur_prob = blur_prob self.hsv_aug_prob = hsv_aug_prob + # for GaussianBlur + self.fil = cv2.getGaussianKernel(ksize=5, sigma=1, ktype=cv2.CV_32F) def __call__(self, data): img = data['image'] @@ -78,7 +80,8 @@ class BaseDataAugmentation(object): img = get_crop(img) if random.random() <= self.blur_prob: - img = blur(img) + # GaussianBlur + img = cv2.sepFilter2D(img, -1, self.fil, self.fil) if random.random() <= self.hsv_aug_prob: img = hsv_aug(img) -- GitLab