Skip to content

Commit

Permalink
Merge pull request #450 from colibrisson/fix_augment
Browse files Browse the repository at this point in the history
disable opencv multithreading
  • Loading branch information
mittagessen authored Feb 21, 2023
2 parents d81e898 + 8e297b4 commit 48c7433
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kraken/lib/dataset/recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,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
2 changes: 2 additions & 0 deletions kraken/lib/dataset/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ def __init__(self, imgs: Sequence[Union[PathLike, str]] = None,
else:
raise Exception('invalid dataset mode')
if augmentation:
import cv2
cv2.setNumThreads(0)
from albumentations import (
Compose, ToFloat, RandomRotate90, Flip, OneOf, MotionBlur, MedianBlur, Blur,
ShiftScaleRotate, OpticalDistortion, ElasticTransform,
Expand Down

0 comments on commit 48c7433

Please sign in to comment.