diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-06-11 23:09:22 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-06-11 23:09:22 +0200 |
commit | 6df941bdf5cad80db38d851dcb23a08a9dc55617 (patch) | |
tree | ecbe41259990955201f910f0113c723cd080ab78 /text_recognizer/models | |
parent | 8177b5210fbbe11bd361dedbd5b4a4e1950bdb2e (diff) |
Fix emnist mapping
Diffstat (limited to 'text_recognizer/models')
-rw-r--r-- | text_recognizer/models/base.py | 4 | ||||
-rw-r--r-- | text_recognizer/models/conformer.py | 2 | ||||
-rw-r--r-- | text_recognizer/models/transformer.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/text_recognizer/models/base.py b/text_recognizer/models/base.py index 886394d..26cc18c 100644 --- a/text_recognizer/models/base.py +++ b/text_recognizer/models/base.py @@ -10,7 +10,7 @@ from torch import nn from torch import Tensor from torchmetrics import Accuracy -from text_recognizer.data.mappings.base import EmnistMapping +from text_recognizer.data.mappings import EmnistMapping class LitBase(LightningModule): @@ -22,7 +22,7 @@ class LitBase(LightningModule): loss_fn: Type[nn.Module], optimizer_configs: DictConfig, lr_scheduler_configs: Optional[DictConfig], - mapping: Type[EmnistMapping], + mapping: EmnistMapping, ) -> None: super().__init__() diff --git a/text_recognizer/models/conformer.py b/text_recognizer/models/conformer.py index 655ebf6..41a9e4d 100644 --- a/text_recognizer/models/conformer.py +++ b/text_recognizer/models/conformer.py @@ -21,7 +21,7 @@ class LitConformer(LitBase): loss_fn: Type[nn.Module], optimizer_configs: DictConfig, lr_scheduler_configs: Optional[DictConfig], - mapping: Type[EmnistMapping], + mapping: EmnistMapping, max_output_len: int = 451, start_token: str = "<s>", end_token: str = "<e>", diff --git a/text_recognizer/models/transformer.py b/text_recognizer/models/transformer.py index 1ffff60..b511947 100644 --- a/text_recognizer/models/transformer.py +++ b/text_recognizer/models/transformer.py @@ -19,7 +19,7 @@ class LitTransformer(LitBase): loss_fn: Type[nn.Module], optimizer_configs: DictConfig, lr_scheduler_configs: Optional[DictConfig], - mapping: Type[EmnistMapping], + mapping: EmnistMapping, max_output_len: int = 451, start_token: str = "<s>", end_token: str = "<e>", |