summaryrefslogtreecommitdiff
path: root/text_recognizer/data/iam_lines.py
diff options
context:
space:
mode:
Diffstat (limited to 'text_recognizer/data/iam_lines.py')
-rw-r--r--text_recognizer/data/iam_lines.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/text_recognizer/data/iam_lines.py b/text_recognizer/data/iam_lines.py
index a79c202..34cf605 100644
--- a/text_recognizer/data/iam_lines.py
+++ b/text_recognizer/data/iam_lines.py
@@ -7,7 +7,7 @@ import json
from pathlib import Path
from typing import List, Sequence, Tuple
-import attr
+from attrs import define, field
from loguru import logger as log
import numpy as np
from PIL import Image, ImageFile, ImageOps
@@ -35,14 +35,14 @@ MAX_LABEL_LENGTH = 89
MAX_WORD_PIECE_LENGTH = 72
-@attr.s(auto_attribs=True, repr=False)
+@define(auto_attribs=True, repr=False)
class IAMLines(BaseDataModule):
"""IAM handwritten lines dataset."""
- dims: Tuple[int, int, int] = attr.ib(
+ dims: Tuple[int, int, int] = field(
init=False, default=(1, IMAGE_HEIGHT, IMAGE_WIDTH)
)
- output_dims: Tuple[int, int] = attr.ib(init=False, default=(MAX_LABEL_LENGTH, 1))
+ output_dims: Tuple[int, int] = field(init=False, default=(MAX_LABEL_LENGTH, 1))
def prepare_data(self) -> None:
"""Creates the IAM lines dataset if not existing."""