diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-29 23:59:52 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-29 23:59:52 +0200 |
commit | 34098ccbbbf6379c0bd29a987440b8479c743746 (patch) | |
tree | a8c68e3036503049fc7034c677ec855465f7a8e0 /text_recognizer/data/iam_synthetic_paragraphs.py | |
parent | c032ffb05a7ed86f8fe5d596f94e8997c558cae8 (diff) |
Configs, refactor with attrs, fix attr bug in iam
Diffstat (limited to 'text_recognizer/data/iam_synthetic_paragraphs.py')
-rw-r--r-- | text_recognizer/data/iam_synthetic_paragraphs.py | 12 |
1 files changed, 2 insertions, 10 deletions
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(): |