From 4e44486aa0e87459bed4b0fe423b16e59c76c1a0 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 2 Oct 2022 03:25:28 +0200 Subject: Move stems to transforms --- text_recognizer/data/stems/image.py | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 text_recognizer/data/stems/image.py (limited to 'text_recognizer/data/stems/image.py') diff --git a/text_recognizer/data/stems/image.py b/text_recognizer/data/stems/image.py deleted file mode 100644 index f04b3a0..0000000 --- a/text_recognizer/data/stems/image.py +++ /dev/null @@ -1,18 +0,0 @@ -from PIL import Image -import torch -from torch import Tensor -import torchvision.transforms as T - - -class ImageStem: - def __init__(self) -> None: - self.pil_transform = T.Compose([]) - self.pil_to_tensor = T.ToTensor() - self.torch_transform = torch.nn.Sequential() - - def __call__(self, img: Image) -> Tensor: - img = self.pil_transform(img) - img = self.pil_to_tensor(img) - with torch.no_grad(): - img = self.torch_transform(img) - return img -- cgit v1.2.3-70-g09d2