this is slowly becoming actually useful

This commit is contained in:
hobogalaxy committed 2020-11-24 18:15:52 +01:00
1 parent d518ddb63d
commit 8628600ea3
15 files changed
+190 -176

No files matched your search

@@ -1,2 +1 @@
from .lightning_module import LitModel
from .transforms import *
@@ -1,5 +1,5 @@
from models.simple_mnist_classifier.lightning_module import LitModel
from models.simple_mnist_classifier import transforms
from lightning_modules.data_modules import transforms
from PIL import Image
@@ -23,7 +23,7 @@ def predict():
img = Image.open("../../example_img.png").convert("L")
# preprocess
img = transforms.test_preprocess(img)
img = transforms.mnist_test_preprocess(img)
img = img.reshape((1, *img.size())) # reshape to form batch of size 1
# inference
@@ -1,15 +0,0 @@
from torchvision import transforms
img_augmentation_transformations = [
transforms.RandomRotation((-10, 10)),
]
train_preprocess = transforms.Compose([
transforms.ToTensor(),
transforms.RandomApply(img_augmentation_transformations, 0.5)
])
test_preprocess = transforms.Compose([
transforms.ToTensor()
])