I basically have two masks but I do not know how to prepare it for a semantic segmentation model like DeepLab and U-Net.It has 5 classes (not including the background)
Color Mask
alligator1_color_mask900×600 2.04 KB
Mask
alligator1_mask900×600 1.23 KB


Is there a Pytorch function to transform the mask into something readily digestible by the model?


My model output is [batcth_size, n_channels, height, width]. What strategy should I use here? Should I create an n_chanbnel=n_classes set of masks with True False per pixel? False being the mask. Keep in mind that there are only few instances of multiple classes in the image. Usually, it only has one class at a time.. Should I use 1 channel with class numbers instead?


In line with strategy on #2, what should be the loss function and output activation layer?