I want to create a dataloader with RGBA images. I have set convert_mode as ‘RGBA’ but still, batch contains images with three channels only. I’m using the following code -
dblock = DataBlock(blocks=(ImageBlock, MaskBlock), splitter = RandomSplitter(valid_pct=0.1), # Random 10% as validation set get_items=get_image_files, get_y=get_msk, ) dls = dblock.dataloaders(Path('images_with_alpha'), bs=1, num_workers=2, convert_mode='RGBA') batch = dls.one_batch() print(batch.shape)
It is giving shape ((1, 3, 400, 280) but I expect it to be (1, 4, 400, 280).
Can you please tell me what’s problem in my code?