I compared different methods of loading image from url. And using IPython.display.Image(url) is the fastest. So Is it possible to work with IPython.core.display.Image in dataset?
from IPython.display import Image
from torchvision.transforms import Resize
import torch 
start=time.time()
a = IPython.display.Image(url)

a = Resize(512)(a)
stop=time.time()

print("durée: {:.2} min {:.4} sec".format((stop - start) // 60,(stop - start) % 60))


I got this error:
img should be PIL Image. Got <class 'IPython.core.display.Image