From 07f2cc3665a1a60efe8ed8073cad6ac4f344b2c2 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 3 Apr 2021 21:59:07 +0200 Subject: Add IAM paragraphs dataset --- text_recognizer/data/iam_lines.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'text_recognizer/data/iam_lines.py') diff --git a/text_recognizer/data/iam_lines.py b/text_recognizer/data/iam_lines.py index 391075a..78bc8e1 100644 --- a/text_recognizer/data/iam_lines.py +++ b/text_recognizer/data/iam_lines.py @@ -211,7 +211,9 @@ def load_line_crops_and_labels(split: str, data_dirname: Path) -> Tuple[List, Li def get_transform(image_width: int, augment: bool = False) -> transforms.Compose: """Augment with brigthness, sligth rotation, slant, translation, scale, and Gaussian noise.""" - def embed_crop(crop: Image, augment: bool = augment, image_width: int = image_width) -> Image: + def embed_crop( + crop: Image, augment: bool = augment, image_width: int = image_width + ) -> Image: # Crop is PIL.Image of dtype="L" (so value range is [0, 255]) image = Image.new("L", (image_width, IMAGE_HEIGHT)) -- cgit v1.2.3-70-g09d2