Skip to content

Commit

Permalink
Lower rotation in line strip dataset augmentation
Browse files Browse the repository at this point in the history
Might be related to #482
  • Loading branch information
mittagessen committed Apr 12, 2023
1 parent c36256c commit dd846ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kraken/lib/dataset/recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ def __init__(self,
else:
self.text_transforms.append(F_t.text_reorder)
if augmentation:
import cv2
cv2.setNumThreads(0)
from albumentations import (
Compose, ToFloat, OneOf, MotionBlur, MedianBlur, Blur,
ShiftScaleRotate, OpticalDistortion, ElasticTransform,
Expand Down Expand Up @@ -496,6 +498,8 @@ def __init__(self, split: Callable[[Union[PathLike, str]], str] = F_t.default_sp
else:
self.text_transforms.append(F_t.text_reorder)
if augmentation:
import cv2
cv2.setNumThreads(0)
from albumentations import (
Compose, ToFloat, OneOf, MotionBlur, MedianBlur, Blur,
ShiftScaleRotate, OpticalDistortion, ElasticTransform,
Expand All @@ -508,7 +512,7 @@ def __init__(self, split: Callable[[Union[PathLike, str]], str] = F_t.default_sp
MedianBlur(blur_limit=3, p=0.1),
Blur(blur_limit=3, p=0.1),
], p=0.2),
ShiftScaleRotate(shift_limit=0.0625, scale_limit=0.2, rotate_limit=45, p=0.2),
ShiftScaleRotate(shift_limit=0.0625, scale_limit=0.2, rotate_limit=3, p=0.2),
OneOf([
OpticalDistortion(p=0.3),
ElasticTransform(p=0.1),
Expand Down

0 comments on commit dd846ef

Please sign in to comment.