Last active
July 26, 2022 18:53
-
-
Save ashhadulislam/d1050d34fb608f590a6a5afd068c59a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torchvision | |
from torchvision import datasets, models, transforms | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
from torch.optim import lr_scheduler | |
import torch.backends.cudnn as cudnn | |
import numpy as np | |
import time | |
import os | |
from PIL import Image | |
import copy | |
import validators | |
from torchvision.datasets import ImageFolder | |
from torch.utils.data import DataLoader, random_split | |
from torchvision import transforms | |
from PIL import Image | |
import requests | |
from io import BytesIO | |
label_map={ | |
0:"Chickenpox", | |
1:"Measles", | |
2:"Monkeypox", | |
3:"Normal" | |
} | |
classes = ('Chickenpox', 'Measles', 'Monkeypox', 'Normal') | |
PATH = './resnet18_net.pth' | |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') | |
data_transform = transforms.Compose([transforms.Grayscale(num_output_channels=1), | |
transforms.Resize((64,64)), | |
transforms.ToTensor()]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment