I have the following code portion:
images = []
image_labels = []

for i, data in enumerate(train_loader,0):
        inputs, labels = data
        inputs, labels = inputs.to(device), labels.to(device)
        inputs, labels = inputs.float(), labels.float()
        images.append(inputs)
        image_labels.append(labels)

image = images[7]
image = image[0,...].permute([1,2,0])
image = image.numpy()
image = (image * 255).astype(np.uint8)
img = Image.fromarray(image,'RGB')
img.show()

As you can see, I’m trying to display the image at index 7. However, every time I run the code I get a different image displayed although using the same index, why is that?
The image displayed also is like degraded and has less quality than the original one.
Any thoughts on that?
Thanks.