I’m tried to load images from npy files with pytorch dataloader. but I failed. So I googling some codes like this.
x_train = np.load('datasets/train.npy', mmap_mode='r') batches = int(float(x_train.shape) / batch_size) for b in range(batches): X = torch.from_numpy(x_train[b * batch_size:(1 + b) * batch_size]) ... from torchvision.utils import save_image save_image(X, 'image.png')
Now I can load images, but they are rotated 90 degrees.
How can I rotate this images ?
Can I rotate this from save_image function?