Thank you for your response and sorry for my late one.
I just tried that and now I got a colored output:

image1000×1000 217 Bytes

But when I look at the saved segments:
segment = mask*curr_color
torchvision.utils.save_image(segment.float()f"{folder}/segment_{class_idx}.png")
I get the following for classes 0, 1, and 2 respectively.

image1000×1000 217 Bytes


image1000×1000 217 Bytes


image1000×1000 217 Bytes

Do you think there is still something wrong going on? I’m not sure why I see black predictions for classes 0 and 2. Nonetheless this is still good progress because at least the model output has some color in it now!