summaryrefslogtreecommitdiff
path: root/text_recognizer/data/iam_lines.py
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-04-03 21:59:07 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-04-03 21:59:07 +0200
commit07f2cc3665a1a60efe8ed8073cad6ac4f344b2c2 (patch)
treed24ae8e3b9b39bfcfb3b850b30cb966eb3b064a7 /text_recognizer/data/iam_lines.py
parent3196144ec99e803cef218295ddea592748931c57 (diff)
Add IAM paragraphs dataset
Diffstat (limited to 'text_recognizer/data/iam_lines.py')
-rw-r--r--text_recognizer/data/iam_lines.py4
1 files changed, 3 insertions, 1 deletions
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))