From d784c49566e5a7705539fb4ceb0461bad8f41361 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Sep 2023 22:10:45 +0200 Subject: Update imports --- text_recognizer/data/base_data_module.py | 1 - text_recognizer/data/base_dataset.py | 2 +- text_recognizer/data/transforms/pad.py | 1 - text_recognizer/model/transformer.py | 2 +- text_recognizer/util/image_utils.py | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) (limited to 'text_recognizer') 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 -- cgit v1.2.3-70-g09d2