From 34098ccbbbf6379c0bd29a987440b8479c743746 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 29 Jul 2021 23:59:52 +0200 Subject: Configs, refactor with attrs, fix attr bug in iam --- text_recognizer/data/iam_synthetic_paragraphs.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 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 00fa2b6..a3697e7 100644 --- a/text_recognizer/data/iam_synthetic_paragraphs.py +++ b/text_recognizer/data/iam_synthetic_paragraphs.py @@ -2,6 +2,7 @@ import random from typing import Any, List, Sequence, Tuple +import attr from loguru import logger import numpy as np from PIL import Image @@ -33,19 +34,10 @@ PROCESSED_DATA_DIRNAME = ( ) +@attr.s(auto_attribs=True) class IAMSyntheticParagraphs(IAMParagraphs): """IAM Handwriting database of synthetic paragraphs.""" - def __init__( - self, - batch_size: int = 16, - num_workers: int = 0, - train_fraction: float = 0.8, - augment: bool = True, - word_pieces: bool = False, - ) -> None: - super().__init__(batch_size, num_workers, train_fraction, augment, word_pieces) - def prepare_data(self) -> None: """Prepare IAM lines to be used to generate paragraphs.""" if PROCESSED_DATA_DIRNAME.exists(): -- cgit v1.2.3-70-g09d2