From 131b6046a220c0019e06e16271b238b43e7182c3 Mon Sep 17 00:00:00 2001 From: Yoann Schneider <yschneider@teklia.com> Date: Tue, 7 Nov 2023 14:40:29 +0100 Subject: [PATCH] use p=1 for equal probability --- dan/ocr/transforms.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dan/ocr/transforms.py b/dan/ocr/transforms.py index 9f6bef8b..d9b80c6a 100644 --- a/dan/ocr/transforms.py +++ b/dan/ocr/transforms.py @@ -195,25 +195,25 @@ def get_augmentation_transforms() -> A.Compose: [ ErosionDilation(min_kernel=1, max_kernel=4, iterations=1), Perspective(scale=(0.05, 0.09), fit_output=True, p=0.4), - GaussianBlur(sigma_limit=2.5, always_apply=True), - GaussNoise(var_limit=50**2, always_apply=True), + GaussianBlur(sigma_limit=2.5, p=1), + GaussNoise(var_limit=50**2, p=1), ColorJitter( contrast=0.2, brightness=0.2, saturation=0.2, hue=0.2, - always_apply=True, + p=1, ), ElasticTransform( alpha=20.0, sigma=5.0, alpha_affine=1.0, border_mode=0, - always_apply=True, + p=1, ), - Sharpen(alpha=(0.0, 1.0), always_apply=True), - Affine(shear={"x": (-20, 20), "y": (0, 0)}, always_apply=True), - CoarseDropout(always_apply=True), + Sharpen(alpha=(0.0, 1.0), p=1), + Affine(shear={"x": (-20, 20), "y": (0, 0)}, p=1), + CoarseDropout(p=1), ToGray(p=0.5), ], n=2, -- GitLab