diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-04-07 22:12:10 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-04-07 22:12:10 +0200 |
commit | 8afa8e1c6e9623b0dea86236da04b2b4173e9443 (patch) | |
tree | 4c9462507b3b3076aa26f08ab629f64b90aed2cb /text_recognizer/data | |
parent | 33190bc9c0c377edab280efe4b0bd0e53bb6cb00 (diff) |
Fixed typing and typos, train script load config, reformatted
Diffstat (limited to 'text_recognizer/data')
-rw-r--r-- | text_recognizer/data/iam_extended_paragraphs.py | 10 | ||||
-rw-r--r-- | text_recognizer/data/iam_paragraphs.py | 9 |
2 files changed, 4 insertions, 15 deletions
diff --git a/text_recognizer/data/iam_extended_paragraphs.py b/text_recognizer/data/iam_extended_paragraphs.py index c144341..d2529b4 100644 --- a/text_recognizer/data/iam_extended_paragraphs.py +++ b/text_recognizer/data/iam_extended_paragraphs.py @@ -18,16 +18,10 @@ class IAMExtendedParagraphs(BaseDataModule): super().__init__(batch_size, num_workers) self.iam_paragraphs = IAMParagraphs( - batch_size, - num_workers, - train_fraction, - augment, + batch_size, num_workers, train_fraction, augment, ) self.iam_synthetic_paragraphs = IAMSyntheticParagraphs( - batch_size, - num_workers, - train_fraction, - augment, + batch_size, num_workers, train_fraction, augment, ) self.dims = self.iam_paragraphs.dims diff --git a/text_recognizer/data/iam_paragraphs.py b/text_recognizer/data/iam_paragraphs.py index 314d458..f588587 100644 --- a/text_recognizer/data/iam_paragraphs.py +++ b/text_recognizer/data/iam_paragraphs.py @@ -161,10 +161,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), @@ -285,9 +282,7 @@ def get_transform(image_shape: Tuple[int, int], augment: bool) -> transforms.Com ), transforms.ColorJitter(brightness=(0.8, 1.6)), transforms.RandomAffine( - degrees=1, - shear=(-10, 10), - interpolation=InterpolationMode.BILINEAR, + degrees=1, shear=(-10, 10), interpolation=InterpolationMode.BILINEAR, ), ] else: |