summaryrefslogtreecommitdiff
path: root/text_recognizer/metadata/iam_paragraphs.py
diff options
context:
space:
mode:
Diffstat (limited to 'text_recognizer/metadata/iam_paragraphs.py')
-rw-r--r--text_recognizer/metadata/iam_paragraphs.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/text_recognizer/metadata/iam_paragraphs.py b/text_recognizer/metadata/iam_paragraphs.py
new file mode 100644
index 0000000..70b802b
--- /dev/null
+++ b/text_recognizer/metadata/iam_paragraphs.py
@@ -0,0 +1,18 @@
+import text_recognizer.metadata.emnist as emnist
+import text_recognizer.metadata.shared as shared
+
+
+PROCESSED_DATA_DIRNAME = shared.DATA_DIRNAME / "processed" / "iam_paragraphs"
+
+NEW_LINE_TOKEN = "\n"
+MAPPING = [*emnist.MAPPING, NEW_LINE_TOKEN]
+
+# must match IMAGE_SCALE_FACTOR for IAMLines to be compatible with synthetic paragraphs
+IMAGE_SCALE_FACTOR = 2
+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)