summaryrefslogtreecommitdiff
path: root/training
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-09-27 01:44:49 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-09-27 01:44:49 +0200
commit9b8e14d89f0ef2508ed11f994f73af624155fe1d (patch)
tree10d9c138f4449646c8b5c0f95003ba86b831d04d /training
parent63376b1c2da81c23ad5239f908b640cd42a514c7 (diff)
Update data modules
Diffstat (limited to 'training')
-rw-r--r--training/conf/datamodule/iam_extended_paragraphs.yaml13
-rw-r--r--training/conf/datamodule/iam_lines.yaml8
-rw-r--r--training/conf/datamodule/target_transform/pad.yaml4
-rw-r--r--training/conf/datamodule/test_transform/default.yaml2
-rw-r--r--training/conf/datamodule/test_transform/lines.yaml6
-rw-r--r--training/conf/datamodule/test_transform/paragraphs.yaml6
-rw-r--r--training/conf/datamodule/transform/default.yaml2
-rw-r--r--training/conf/datamodule/transform/emnist_lines.yaml14
-rw-r--r--training/conf/datamodule/transform/lines.yaml23
-rw-r--r--training/conf/datamodule/transform/paragraphs.yaml30
10 files changed, 16 insertions, 92 deletions
diff --git a/training/conf/datamodule/iam_extended_paragraphs.yaml b/training/conf/datamodule/iam_extended_paragraphs.yaml
index 0921b25..c46714c 100644
--- a/training/conf/datamodule/iam_extended_paragraphs.yaml
+++ b/training/conf/datamodule/iam_extended_paragraphs.yaml
@@ -3,9 +3,16 @@ batch_size: 4
num_workers: 12
train_fraction: 0.8
pin_memory: true
-transform: transform/paragraphs.yaml
-test_transform: test_transform/paragraphs.yaml
-target_transform: target_transform/pad.yaml
+transform:
+ _target_: text_recognizer.data.stems.paragraph.ParagraphStem
+ augment: true
+test_transform:
+ _target_: text_recognizer.data.stems.paragraph.ParagraphStem
+ augment: false
+target_transform:
+ _target_: text_recognizer.data.transforms.pad.Pad
+ max_len: 682
+ pad_index: 3
mapping:
_target_: text_recognizer.data.mappings.EmnistMapping
extra_symbols: ["\n"]
diff --git a/training/conf/datamodule/iam_lines.yaml b/training/conf/datamodule/iam_lines.yaml
index 85a023b..4f1f1b8 100644
--- a/training/conf/datamodule/iam_lines.yaml
+++ b/training/conf/datamodule/iam_lines.yaml
@@ -3,7 +3,11 @@ batch_size: 8
num_workers: 12
train_fraction: 0.9
pin_memory: true
-transform: transform/lines.yaml
-test_transform: test_transform/lines.yaml
+transform:
+ _target_: text_recognizer.data.stems.line.IamLinesStem
+ augment: true
+test_transform:
+ _target_: text_recognizer.data.stems.line.IamLinesStem
+ augment: false
mapping:
_target_: text_recognizer.data.mappings.EmnistMapping
diff --git a/training/conf/datamodule/target_transform/pad.yaml b/training/conf/datamodule/target_transform/pad.yaml
deleted file mode 100644
index 854c24c..0000000
--- a/training/conf/datamodule/target_transform/pad.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-pad:
- _target_: text_recognizer.data.transforms.pad.Pad
- max_len: 682
- pad_index: 3
diff --git a/training/conf/datamodule/test_transform/default.yaml b/training/conf/datamodule/test_transform/default.yaml
deleted file mode 100644
index d6f6d78..0000000
--- a/training/conf/datamodule/test_transform/default.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-to_tensor:
- _target_: torchvision.transforms.ToTensor
diff --git a/training/conf/datamodule/test_transform/lines.yaml b/training/conf/datamodule/test_transform/lines.yaml
deleted file mode 100644
index a14ec82..0000000
--- a/training/conf/datamodule/test_transform/lines.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-embed_crop:
- _target_: text_recognizer.data.transforms.embed_crop.EmbedCrop
- augment: true
-
-to_tensor:
- _target_: torchvision.transforms.ToTensor
diff --git a/training/conf/datamodule/test_transform/paragraphs.yaml b/training/conf/datamodule/test_transform/paragraphs.yaml
deleted file mode 100644
index a69eae9..0000000
--- a/training/conf/datamodule/test_transform/paragraphs.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-center_crop:
- _target_: torchvision.transforms.CenterCrop
- size: [576, 640]
-
-to_tensor:
- _target_: torchvision.transforms.ToTensor
diff --git a/training/conf/datamodule/transform/default.yaml b/training/conf/datamodule/transform/default.yaml
deleted file mode 100644
index d6f6d78..0000000
--- a/training/conf/datamodule/transform/default.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-to_tensor:
- _target_: torchvision.transforms.ToTensor
diff --git a/training/conf/datamodule/transform/emnist_lines.yaml b/training/conf/datamodule/transform/emnist_lines.yaml
deleted file mode 100644
index 986ba20..0000000
--- a/training/conf/datamodule/transform/emnist_lines.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-to_tensor:
- _target_: torchvision.transforms.ToTensor
-
-color_jitter:
- _target_: torchvision.transforms.ColorJitter
- brightness: [0.5, 1.0]
-
-random_affine:
- _target_: torchvision.transforms.RandomAffine
- degrees: 3
- translate: [0.0, 0.05]
- scale: [0.4, 1.1]
- shear: [-40, 50]
- fill: 0
diff --git a/training/conf/datamodule/transform/lines.yaml b/training/conf/datamodule/transform/lines.yaml
deleted file mode 100644
index 6bd35ef..0000000
--- a/training/conf/datamodule/transform/lines.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-embed_crop:
- _target_: text_recognizer.data.transforms.embed_crop.EmbedCrop
- augment: false
-
-color_jitter:
- _target_: torchvision.transforms.ColorJitter
- brightness: [0.8, 1.6]
-
-random_affine:
- _target_: torchvision.transforms.RandomAffine
- degrees: 1
- shear: [-10, 10]
- interpolation: BILINEAR
- fill: 0
-
-random_perspective:
- _target_: torchvision.transforms.RandomPerspective
- distortion_scale: 0.05
- p: 0.25
- fill: 0
-
-to_tensor:
- _target_: torchvision.transforms.ToTensor
diff --git a/training/conf/datamodule/transform/paragraphs.yaml b/training/conf/datamodule/transform/paragraphs.yaml
deleted file mode 100644
index 4f260d0..0000000
--- a/training/conf/datamodule/transform/paragraphs.yaml
+++ /dev/null
@@ -1,30 +0,0 @@
-# random_crop:
-# _target_: torchvision.transforms.RandomCrop
-# size: [576, 640]
-# padding: null
-# pad_if_needed: true
-# fill: 0
-# padding_mode: constant
-
-center_crop:
- _target_: torchvision.transforms.CenterCrop
- size: [576, 640]
-
-color_jitter:
- _target_: torchvision.transforms.ColorJitter
- brightness: [0.8, 1.6]
-
-random_affine:
- _target_: torchvision.transforms.RandomAffine
- degrees: 1
- shear: [-5, 5]
- interpolation: BILINEAR
-
-random_perspective:
- _target_: torchvision.transforms.RandomPerspective
- distortion_scale: 0.05
- p: 0.25
- fill: 0
-
-to_tensor:
- _target_: torchvision.transforms.ToTensor