From 6df941bdf5cad80db38d851dcb23a08a9dc55617 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 11 Jun 2022 23:09:22 +0200 Subject: Fix emnist mapping --- text_recognizer/data/iam_synthetic_paragraphs.py | 25 +++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'text_recognizer/data/iam_synthetic_paragraphs.py') diff --git a/text_recognizer/data/iam_synthetic_paragraphs.py b/text_recognizer/data/iam_synthetic_paragraphs.py index 1dc517d..d51e010 100644 --- a/text_recognizer/data/iam_synthetic_paragraphs.py +++ b/text_recognizer/data/iam_synthetic_paragraphs.py @@ -1,6 +1,6 @@ """IAM Synthetic Paragraphs Dataset class.""" import random -from typing import Any, List, Sequence, Tuple +from typing import Any, Callable, List, Optional, Sequence, Tuple from loguru import logger as log import numpy as np @@ -36,8 +36,27 @@ PROCESSED_DATA_DIRNAME = ( class IAMSyntheticParagraphs(IAMParagraphs): """IAM Handwriting database of synthetic paragraphs.""" - def __init__(self) -> None: - super().__init__() + def __init__( + self, + mapping: EmnistMapping, + transform: Optional[Callable] = None, + test_transform: Optional[Callable] = None, + target_transform: Optional[Callable] = None, + train_fraction: float = 0.8, + batch_size: int = 16, + num_workers: int = 0, + pin_memory: bool = True, + ) -> None: + super().__init__( + mapping, + transform, + test_transform, + target_transform, + train_fraction, + batch_size, + num_workers, + pin_memory, + ) def prepare_data(self) -> None: """Prepare IAM lines to be used to generate paragraphs.""" -- cgit v1.2.3-70-g09d2