diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2024-04-15 21:47:54 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2024-04-15 21:47:54 +0200 |
commit | 9ce21f569ecac03f15f2ad669fde3dd4a512f8cc (patch) | |
tree | e6f5bbf4cfe758788fd6ad3679b714d4ecfad568 /text_recognizer/model | |
parent | a93dcc5b9c8160a441c5b5f99f2f59264778ef91 (diff) |
Format
Diffstat (limited to 'text_recognizer/model')
-rw-r--r-- | text_recognizer/model/base.py | 4 | ||||
-rw-r--r-- | text_recognizer/model/transformer.py | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/text_recognizer/model/base.py b/text_recognizer/model/base.py index 9a751bf..c662583 100644 --- a/text_recognizer/model/base.py +++ b/text_recognizer/model/base.py @@ -2,11 +2,11 @@ from typing import Any, Dict, Optional, Tuple, Type import hydra +import pytorch_lightning as L import torch from loguru import logger as log from omegaconf import DictConfig -import pytorch_lightning as L -from torch import nn, Tensor +from torch import Tensor, nn from text_recognizer.data.tokenizer import Tokenizer diff --git a/text_recognizer/model/transformer.py b/text_recognizer/model/transformer.py index 5842bdb..783e134 100644 --- a/text_recognizer/model/transformer.py +++ b/text_recognizer/model/transformer.py @@ -3,11 +3,12 @@ from typing import Callable, Optional, Tuple, Type import torch from omegaconf import DictConfig -from torch import nn, Tensor +from torch import Tensor, nn from torchmetrics import CharErrorRate, WordErrorRate -from text_recognizer.decoder.greedy_decoder import GreedyDecoder from text_recognizer.data.tokenizer import Tokenizer +from text_recognizer.decoder.greedy_decoder import GreedyDecoder + from .base import LitBase |