summaryrefslogtreecommitdiff
path: root/text_recognizer/models
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-09-18 18:12:54 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-09-18 18:12:54 +0200
commit8eec5f3d4ce41c2ba30f0f1ab3f506fc3c0dd263 (patch)
tree19244a467e90ed8b919cdf2912d9e1b141ea1801 /text_recognizer/models
parent2cc6aa059139b57057609817913ad515063c2eab (diff)
Formats
Diffstat (limited to 'text_recognizer/models')
-rw-r--r--text_recognizer/models/base.py5
-rw-r--r--text_recognizer/models/transformer.py4
2 files changed, 4 insertions, 5 deletions
diff --git a/text_recognizer/models/base.py b/text_recognizer/models/base.py
index 90752e9..f917635 100644
--- a/text_recognizer/models/base.py
+++ b/text_recognizer/models/base.py
@@ -2,12 +2,11 @@
from typing import Any, Dict, Optional, Tuple, Type
import hydra
+import torch
from loguru import logger as log
from omegaconf import DictConfig
from pytorch_lightning import LightningModule
-import torch
-from torch import nn
-from torch import Tensor
+from torch import Tensor, nn
from torchmetrics import Accuracy
from text_recognizer.data.mappings import EmnistMapping
diff --git a/text_recognizer/models/transformer.py b/text_recognizer/models/transformer.py
index f44241d..dcec756 100644
--- a/text_recognizer/models/transformer.py
+++ b/text_recognizer/models/transformer.py
@@ -1,9 +1,9 @@
"""Lightning model for base Transformers."""
from typing import Optional, Tuple, Type
-from omegaconf import DictConfig
import torch
-from torch import nn, Tensor
+from omegaconf import DictConfig
+from torch import Tensor, nn
from text_recognizer.data.mappings import EmnistMapping
from text_recognizer.models.base import LitBase