Pytorch transform accept PIL Image, Tensor image or batch of tensor images as input.
Reference: torchvision.transforms — Torchvision master documentation
Maybe you can add this to your code, test whether it works:
from PIL import Image

image = Image.fromarray(self.dataset["images"][idx]