Maybe when you are doing your resize to ~1/64th of the original image the masks are not surviving.



 Sehajmeet_Sohal:

mask_rescaled = transform.resize(mask, (mask.shape[0] // 8 + 6, mask.shape[1] // 8 + 6), anti_aliasing=True, preserve_range=True, mode='constant')



Can you post the code of your transform.resize?
Because it does not seem to be the standard torchvision.transforms.Resize by looking at the input arguments.