diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-10-02 03:25:28 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-10-02 03:25:28 +0200 |
commit | 4e44486aa0e87459bed4b0fe423b16e59c76c1a0 (patch) | |
tree | a0ce9f72d9000ac8e0959f159a66a7f1dbcf8892 /text_recognizer/data/stems/image.py | |
parent | 1e0378e1ba1cdab3c064473ef951b97515f28947 (diff) |
Move stems to transforms
Diffstat (limited to 'text_recognizer/data/stems/image.py')
-rw-r--r-- | text_recognizer/data/stems/image.py | 18 |
1 files changed, 0 insertions, 18 deletions
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 |