From 8ac11637f025b8a9cdf33be89b0b377477c81a88 Mon Sep 17 00:00:00 2001 From: Benjamin Kiessling Date: Tue, 8 Oct 2024 16:54:58 +0200 Subject: [PATCH] Affine transform arg in elastictransform is deprecated factor it out. Fixes #648 --- kraken/lib/dataset/recognition.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kraken/lib/dataset/recognition.py b/kraken/lib/dataset/recognition.py index 75a3bb9a8..4a1d6e64d 100644 --- a/kraken/lib/dataset/recognition.py +++ b/kraken/lib/dataset/recognition.py @@ -59,7 +59,7 @@ def __init__(self): import cv2 cv2.setNumThreads(0) from albumentations import (Blur, Compose, ElasticTransform, - MedianBlur, MotionBlur, OneOf, + MedianBlur, MotionBlur, OneOf, Affine, OpticalDistortion, PixelDropout, ShiftScaleRotate, ToFloat) @@ -74,7 +74,8 @@ def __init__(self): ShiftScaleRotate(shift_limit=0.0625, scale_limit=0.2, rotate_limit=1, p=0.2), OneOf([ OpticalDistortion(p=0.3), - ElasticTransform(alpha=64, sigma=25, alpha_affine=0.25, p=0.1), + ElasticTransform(alpha=64, sigma=25, p=0.1), + Affine(translate_px=(0, 5), rotate=(-3, 3), shear=(-5, 5), p=0.2) ], p=0.2), ], p=0.5)