Segmentation masks

i have a mask file saved as a .tiff file ranging from 0…255.
I would like to split it into X classes so my tensor look something like this [batch, classes, width, height].
My network currently does Binary classification and outputs [9, 2, 256, 256].

So i would like to match this with the segmentation mask?, and understand how i should do if i wannt to increase the number of classes?

1 Like

The segmentation mask in a multi-class classification use case should have the shape [batch_size, height, width] and contain the class indices in the range [0, nb_classes-1].
Does your target image contain 256 unique classes? If not, you should map each color value to a class index.

The output of your model should have the shape [batch_size, nb_classes, height, width].

2 Likes

i get done same but i get same size output image


i get wrong image
i want to get like this image below