From 3b06ef615a8db67a03927576e0c12fbfb2501f5f Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Mon, 14 Sep 2020 22:15:47 +0200 Subject: Fixed CTC loss. --- src/text_recognizer/datasets/emnist_dataset.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/text_recognizer/datasets/emnist_dataset.py') diff --git a/src/text_recognizer/datasets/emnist_dataset.py b/src/text_recognizer/datasets/emnist_dataset.py index 81268fb..d01dcee 100644 --- a/src/text_recognizer/datasets/emnist_dataset.py +++ b/src/text_recognizer/datasets/emnist_dataset.py @@ -13,17 +13,10 @@ from torchvision.datasets import EMNIST from torchvision.transforms import Compose, ToTensor from text_recognizer.datasets.dataset import Dataset +from text_recognizer.datasets.transforms import Transpose from text_recognizer.datasets.util import DATA_DIRNAME -class Transpose: - """Transposes the EMNIST image to the correct orientation.""" - - def __call__(self, image: Image) -> np.ndarray: - """Swaps axis.""" - return np.array(image).swapaxes(0, 1) - - class EmnistDataset(Dataset): """This is a class for resampling and subsampling the PyTorch EMNIST dataset.""" -- cgit v1.2.3-70-g09d2