summaryrefslogtreecommitdiff
path: root/text_recognizer
diff options
context:
space:
mode:
Diffstat (limited to 'text_recognizer')
-rw-r--r--text_recognizer/data/base_data_module.py1
-rw-r--r--text_recognizer/data/base_dataset.py2
-rw-r--r--text_recognizer/data/transforms/pad.py1
-rw-r--r--text_recognizer/model/transformer.py2
-rw-r--r--text_recognizer/util/image_utils.py2
5 files changed, 3 insertions, 5 deletions
diff --git a/text_recognizer/data/base_data_module.py b/text_recognizer/data/base_data_module.py
index 3cb0aa2..6efa4fb 100644
--- a/text_recognizer/data/base_data_module.py
+++ b/text_recognizer/data/base_data_module.py
@@ -1,5 +1,4 @@
"""Base lightning DataModule class."""
-from pathlib import Path
from typing import Callable, Dict, Optional, Tuple, TypeVar
import pytorch_lightning as L
diff --git a/text_recognizer/data/base_dataset.py b/text_recognizer/data/base_dataset.py
index b840bc8..12f524c 100644
--- a/text_recognizer/data/base_dataset.py
+++ b/text_recognizer/data/base_dataset.py
@@ -1,5 +1,5 @@
"""Base PyTorch Dataset class."""
-from typing import Callable, Dict, Optional, Sequence, Tuple, Union
+from typing import Callable, Dict, Sequence, Tuple, Union
import torch
from torch import Tensor
diff --git a/text_recognizer/data/transforms/pad.py b/text_recognizer/data/transforms/pad.py
index df1d83f..baf637a 100644
--- a/text_recognizer/data/transforms/pad.py
+++ b/text_recognizer/data/transforms/pad.py
@@ -1,7 +1,6 @@
"""Pad targets to equal length."""
import torch
-import torch.functional as F
from torch import Tensor
diff --git a/text_recognizer/model/transformer.py b/text_recognizer/model/transformer.py
index 598d995..5842bdb 100644
--- a/text_recognizer/model/transformer.py
+++ b/text_recognizer/model/transformer.py
@@ -6,7 +6,7 @@ from omegaconf import DictConfig
from torch import nn, Tensor
from torchmetrics import CharErrorRate, WordErrorRate
-from .greedy_decoder import GreedyDecoder
+from text_recognizer.decoder.greedy_decoder import GreedyDecoder
from text_recognizer.data.tokenizer import Tokenizer
from .base import LitBase
diff --git a/text_recognizer/util/image_utils.py b/text_recognizer/util/image_utils.py
index fcb094c..7ec7307 100644
--- a/text_recognizer/util/image_utils.py
+++ b/text_recognizer/util/image_utils.py
@@ -2,7 +2,7 @@
import base64
from io import BytesIO
from pathlib import Path
-from typing import Any, Union
+from typing import Union
import smart_open
from PIL import Image