diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-08 22:27:33 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-08 22:27:33 +0200 |
commit | 07186625583f6101eee6babc52d57d5c2cb28b05 (patch) | |
tree | dac54196a148779dbdc8d8bdce5c8a33bb3009fd /text_recognizer | |
parent | 97092991618d8c7ddfc477f2ceba0749071587d0 (diff) |
Refactor
Diffstat (limited to 'text_recognizer')
-rw-r--r-- | text_recognizer/data/iam_paragraphs.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/text_recognizer/data/iam_paragraphs.py b/text_recognizer/data/iam_paragraphs.py index 445b788..bdfb490 100644 --- a/text_recognizer/data/iam_paragraphs.py +++ b/text_recognizer/data/iam_paragraphs.py @@ -18,8 +18,8 @@ from text_recognizer.data.base_dataset import ( ) from text_recognizer.data.base_data_module import BaseDataModule, load_and_print_info from text_recognizer.data.emnist import emnist_mapping -from text_recognizer.data.mappings import WordPieceMapping from text_recognizer.data.iam import IAM +from text_recognizer.data.mappings import WordPieceMapping from text_recognizer.data.transforms import WordPiece @@ -159,10 +159,7 @@ def get_dataset_properties() -> Dict: "min": min(_get_property_values("num_lines")), "max": max(_get_property_values("num_lines")), }, - "crop_shape": { - "min": crop_shapes.min(axis=0), - "max": crop_shapes.max(axis=0), - }, + "crop_shape": {"min": crop_shapes.min(axis=0), "max": crop_shapes.max(axis=0),}, "aspect_ratio": { "min": aspect_ratio.min(axis=0), "max": aspect_ratio.max(axis=0), @@ -283,9 +280,7 @@ def get_transform(image_shape: Tuple[int, int], augment: bool) -> T.Compose: ), T.ColorJitter(brightness=(0.8, 1.6)), T.RandomAffine( - degrees=1, - shear=(-10, 10), - interpolation=InterpolationMode.BILINEAR, + degrees=1, shear=(-10, 10), interpolation=InterpolationMode.BILINEAR, ), ] else: |