Training Semantic Segmentation

I mapped the target RGB into a single channel uint16 images where the values of the pixels indicate the classes. The formula is ObjectClassMasks = (uint16(R)/10)*256+uint16(G) where R is the red channel and G is the green channel. I don’t think there is a way to convert that into an image with [n_classes height width].

Also, can you provide more information on how to create my own mapping?

Thank you very much