title: Why is PIL used so often with Pytorch?
body: <p>I noticed that a lot of dataloaders use PIL to load and transform images, e.g. the dataset builders in torchvision.datasets.folder.</p>
  
  <p>My question is: why use PIL? You would need to do an np.asarray operation before turning it into a tensor. OpenCV seems to load it directly as a numpy array, and is faster too.</p>
  
  <p>One reason I can think of is because PIL has a rich transforms library, but I feel like several of those transforms can be quickly implemented.</p>