From 65df6a72b002c4b23d6f2eb545839e157f7f2aa0 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 5 Jun 2022 23:39:11 +0200 Subject: Remove attrs --- text_recognizer/data/iam_paragraphs.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'text_recognizer/data/iam_paragraphs.py') diff --git a/text_recognizer/data/iam_paragraphs.py b/text_recognizer/data/iam_paragraphs.py index b605bbc..dde505d 100644 --- a/text_recognizer/data/iam_paragraphs.py +++ b/text_recognizer/data/iam_paragraphs.py @@ -3,7 +3,6 @@ import json from pathlib import Path from typing import Dict, List, Optional, Sequence, Tuple -from attrs import define, field from loguru import logger as log import numpy as np from PIL import Image, ImageOps @@ -33,15 +32,13 @@ MAX_LABEL_LENGTH = 682 MAX_WORD_PIECE_LENGTH = 451 -@define(auto_attribs=True, repr=False) class IAMParagraphs(BaseDataModule): """IAM handwriting database paragraphs.""" - # Placeholders - dims: Tuple[int, int, int] = field( - init=False, default=(1, IMAGE_HEIGHT, IMAGE_WIDTH) - ) - output_dims: Tuple[int, int] = field(init=False, default=(MAX_LABEL_LENGTH, 1)) + def __init__(self) -> None: + super().__init__() + self.dims = (1, IMAGE_HEIGHT, IMAGE_WIDTH) + self.output_dims = (MAX_LABEL_LENGTH, 1) def prepare_data(self) -> None: """Create data for training/testing.""" -- cgit v1.2.3-70-g09d2