juliendenize/torchaug

Add Pillow and OpenCV support for conversion

juliendenize opened this issue · 1 comments

Unlike Torchvision, Torchaug do not support transforms for Pillow images as it does not make sense for batches.

However it makes sense to be able to convert pillow images and opencv to images thanks to, among other things, the to_image function.

Opencv is supported via the numpy array conversion of to_image:

image = cv2.imread('Penguins.jpg')
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # returns array

image_tatensor = to_image(image)