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_extended_paragraphs.py | |
| parent | c032ffb05a7ed86f8fe5d596f94e8997c558cae8 (diff) | |
Configs, refactor with attrs, fix attr bug in iam
Diffstat (limited to 'text_recognizer/data/iam_extended_paragraphs.py')
| -rw-r--r-- | text_recognizer/data/iam_extended_paragraphs.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/text_recognizer/data/iam_extended_paragraphs.py b/text_recognizer/data/iam_extended_paragraphs.py index 886e37e..58c7369 100644 --- a/text_recognizer/data/iam_extended_paragraphs.py +++ b/text_recognizer/data/iam_extended_paragraphs.py @@ -13,23 +13,24 @@ from text_recognizer.data.iam_synthetic_paragraphs import IAMSyntheticParagraphs @attr.s(auto_attribs=True) class IAMExtendedParagraphs(BaseDataModule): - train_fraction: float = attr.ib() + augment: bool = attr.ib(default=True) + train_fraction: float = attr.ib(default=0.8) word_pieces: bool = attr.ib(default=False) def __attrs_post_init__(self) -> None: self.iam_paragraphs = IAMParagraphs( - self.batch_size, - self.num_workers, - self.train_fraction, - self.augment, - self.word_pieces, + batch_size=self.batch_size, + num_workers=self.num_workers, + train_fraction=self.train_fraction, + augment=self.augment, + word_pieces=self.word_pieces, ) self.iam_synthetic_paragraphs = IAMSyntheticParagraphs( - self.batch_size, - self.num_workers, - self.train_fraction, - self.augment, - self.word_pieces, + batch_size=self.batch_size, + num_workers=self.num_workers, + train_fraction=self.train_fraction, + augment=self.augment, + word_pieces=self.word_pieces, ) self.dims = self.iam_paragraphs.dims |