The neural net was trained with inputs that have been imported and transformed in the following way:
transform = transforms.Compose(
[transforms.ToTensor()])
data_path = '/home/tim/Documents/trainset/'
traindataset = torchvision.datasets.ImageFolder(
root=data_path,
transform=transform
)
trainloader = torch.utils.data.DataLoader(
traindataset,
batch_size=3,
num_workers=1,
shuffle=True
)
I now have a single numpy array called img that represents an image in RGB with pixel values ranging from 0 to 255. how can i apply trainloader and all the transforms to turn this array into a single element batch to be put through my neural network?