I am working on an image-to-image translation GANs. I have a transparent 4 channel image. But I am getting on 3 channels with PIL and the transparent part is getting blacked out. How I can read the image in PyTorch. Is there any method available?
I think you should convert the image to the right format using PIL could be the solution:
from PIL import Image img = Image.open(img_path) # converts to 4 channels, where A represents the alpha/transparent channel img.convert(RGBA)