This is how (part of) my code looks like:
class ImageDataset(Dataset):
    def __init__(self, csv_file, root_dir):
        self.file_source = pd.read_csv(csv_file)
        self.root_dir = root_dir

    def __len__(self):
        return len(self.file_source)

    def __getitem__(self, idx):
        img_name = os.path.join(self.root_dir,
                                self.file_source.iloc[idx, 1])
        image = io.imread(img_name)
        image = image.transpose(2, 0, 1)
        image = torch.from_numpy(image)
        image = image.float()
        
        return image

rocket_dataset = ImageDataset(csv_file='./rocket_images_reduced/rockets.csv',
                              root_dir='./rocket_images_reduced/train/')

img_test = rocket_dataset[0]

npimg = img_test.numpy() # img is your tensor
plt.imshow(np.transpose(npimg, (1, 2, 0)))
plt.show()