Skip to content

Commit

Permalink
fix eval
Browse files Browse the repository at this point in the history
  • Loading branch information
Owyii committed Apr 14, 2024
1 parent a34d5a3 commit 12a61ff
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions mACHINE-LEARNINGS/eval.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import warnings; warnings.filterwarnings('ignore')
import torch
from torch.utils.data import DataLoader
from torchvision.transforms import Resize
from torchvision.io import read_image, ImageReadMode
from classes.MemeDataset import MemeDataset
from models.DankCNN import DankCNN
import argparse
from torchvision import transforms

cls = {0: 'dank', 1: 'normie'}

Expand All @@ -23,9 +23,15 @@ def eval(image):
- Load all data: train, test, validation
"""
image = read_image(image, ImageReadMode.RGB).float()
resize = Resize(size = (160, 160))
image = resize(image)

data_transforms = {
'test': transforms.Compose([
transforms.ToPILImage(),
transforms.Resize(320),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
}
image = data_transforms['test'](image)
"""
MODEL INITIALIZATION
- optimizer: Adam with weight decay as regularization technique
Expand Down

0 comments on commit 12a61ff

Please sign in to comment.