summaryrefslogtreecommitdiff
path: root/text_recognizer/metadata
diff options
context:
space:
mode:
Diffstat (limited to 'text_recognizer/metadata')
-rw-r--r--text_recognizer/metadata/iam_lines.py5
-rw-r--r--text_recognizer/metadata/iam_paragraphs.py6
-rw-r--r--text_recognizer/metadata/iam_synthetic_paragraphs.py4
3 files changed, 12 insertions, 3 deletions
diff --git a/text_recognizer/metadata/iam_lines.py b/text_recognizer/metadata/iam_lines.py
index 73b2a28..a94041c 100644
--- a/text_recognizer/metadata/iam_lines.py
+++ b/text_recognizer/metadata/iam_lines.py
@@ -9,7 +9,12 @@ CHAR_WIDTH = emnist.INPUT_SHAPE[0] // IMAGE_SCALE_FACTOR # rough estimate
IMAGE_HEIGHT = 112 // IMAGE_SCALE_FACTOR
IMAGE_WIDTH = 3072 // IMAGE_SCALE_FACTOR # rounding up IAMLines empirical maximum width
+SEED = 4711
DIMS = (1, IMAGE_HEIGHT, IMAGE_WIDTH)
OUTPUT_DIMS = (89, 1)
+IMAGE_HEIGHT = 56
+IMAGE_WIDTH = 1024
+MAX_LABEL_LENGTH = 89
+MAX_WORD_PIECE_LENGTH = 72
MAPPING = emnist.MAPPING
diff --git a/text_recognizer/metadata/iam_paragraphs.py b/text_recognizer/metadata/iam_paragraphs.py
index 70b802b..7bb909a 100644
--- a/text_recognizer/metadata/iam_paragraphs.py
+++ b/text_recognizer/metadata/iam_paragraphs.py
@@ -8,11 +8,13 @@ NEW_LINE_TOKEN = "\n"
MAPPING = [*emnist.MAPPING, NEW_LINE_TOKEN]
# must match IMAGE_SCALE_FACTOR for IAMLines to be compatible with synthetic paragraphs
+SEED = 4711
IMAGE_SCALE_FACTOR = 2
+IMAGE_HEIGHT = 1152 // IMAGE_SCALE_FACTOR
+IMAGE_WIDTH = 1280 // IMAGE_SCALE_FACTOR
+MAX_LABEL_LENGTH = 682
IMAGE_HEIGHT, IMAGE_WIDTH = 576, 640
IMAGE_SHAPE = (IMAGE_HEIGHT, IMAGE_WIDTH)
-MAX_LABEL_LENGTH = 682
-
DIMS = (1, IMAGE_HEIGHT, IMAGE_WIDTH)
OUTPUT_DIMS = (MAX_LABEL_LENGTH, 1)
diff --git a/text_recognizer/metadata/iam_synthetic_paragraphs.py b/text_recognizer/metadata/iam_synthetic_paragraphs.py
index 15bcfc8..6c11d28 100644
--- a/text_recognizer/metadata/iam_synthetic_paragraphs.py
+++ b/text_recognizer/metadata/iam_synthetic_paragraphs.py
@@ -2,5 +2,7 @@ import text_recognizer.metadata.iam_paragraphs as iam_paragraphs
import text_recognizer.metadata.shared as shared
NEW_LINE_TOKEN = iam_paragraphs.NEW_LINE_TOKEN
-
+DATA_DIRNAME = shared.DATA_DIRNAME
PROCESSED_DATA_DIRNAME = shared.DATA_DIRNAME / "processed" / "iam_synthetic_paragraphs"
+
+MAX_LABEL_LENGTH = 682