Image segmentation resizing

Hello all,

I am solving an image segmentation task. Initially I have images let’s say of dimensions 1024 x 1024 and their corresponding ground truth segmentation masks 1024 x 1024 as well. When I pass batch_tfms=[*aug_transforms(size=np.array([size,size]))] where size could be 64, 128, 2048, etc. which resizing algorithms are applied to the input image and the corresponding ground truth segmentation mask? Are they the same?

Thank you in advance.

As Jeremy always says, “Try it an see”

But I do believe the if you are using the segmentation data block, they both are resized to the same size.

Hello Edward,

Thank you for you answer. I understand that they both resized to the same size. But which algorithms are applied for this procedure? And is the emerging mapping (image pixel to label pixel) still valid? Are there any resources for this procedure?

I believe these are the defaults

In my experience, the transforms are applied appropriately to make the segmentation work if you are using the unet_learner.

Maybe this example may help?

I think I understood the question, which can be reformulated as: “do the transformations applied introduce artifacts in masks due to interpolation, like they do in RGB images?” Regarding resize, I am almost sure it does not introduce artifacts; regarding other transformations, I did not check, but masks remain valid thus at least the number of classes remains the same. However, artifacts would be mostly on the edges, and likely small.
You may check the source code to see which algorithm is used specifically on masks.