diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-09-27 01:44:49 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-09-27 01:44:49 +0200 |
commit | 9b8e14d89f0ef2508ed11f994f73af624155fe1d (patch) | |
tree | 10d9c138f4449646c8b5c0f95003ba86b831d04d /text_recognizer/data/iam_paragraphs.py | |
parent | 63376b1c2da81c23ad5239f908b640cd42a514c7 (diff) |
Update data modules
Diffstat (limited to 'text_recognizer/data/iam_paragraphs.py')
-rw-r--r-- | text_recognizer/data/iam_paragraphs.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/text_recognizer/data/iam_paragraphs.py b/text_recognizer/data/iam_paragraphs.py index eec1b1f..fe1f15c 100644 --- a/text_recognizer/data/iam_paragraphs.py +++ b/text_recognizer/data/iam_paragraphs.py @@ -16,9 +16,10 @@ from text_recognizer.data.base_dataset import ( split_dataset, ) from text_recognizer.data.iam import IAM +from text_recognizer.data.transforms.pad import Pad from text_recognizer.data.mappings import EmnistMapping -from text_recognizer.data.transforms.load_transform import load_transform_from_file -from text_recognizer.metadata import iam_paragraphs as metadata +from text_recognizer.data.stems.paragraph import ParagraphStem +import text_recognizer.metadata.iam_paragraphs as metadata class IAMParagraphs(BaseDataModule): @@ -294,8 +295,13 @@ def _num_lines(label: str) -> int: def create_iam_paragraphs() -> None: """Loads and displays dataset statistics.""" - transform = load_transform_from_file("transform/paragraphs.yaml") - test_transform = load_transform_from_file("test_transform/paragraphs_test.yaml") + transform = ParagraphStem() + test_transform = ParagraphStem() + target_transform = Pad(metadata.MAX_LABEL_LENGTH, 3) load_and_print_info( - IAMParagraphs(transform=transform, test_transform=test_transform) + IAMParagraphs( + transform=transform, + test_transform=test_transform, + target_transform=target_transform, + ) ) |