What does the mask look like when doing semantic segmentation. I have 3 classes (background, liver, tumour).
Currently the input to my segmentation model looks like this
(32, 128, 128, 3) where 32 = batch_size, 128 = image width/height, 3 number of color channels -> RGB.
For labeling the masks i do the following.
- Iterate through all the pixels of the image
- Assign each pixel a class:
- If the pixel belongs to the background, I set the RGB value at this position to [0,0,1]
- If the pixel belongs to the liver, I set the RGB value at at this position to [0,1,0]
- If the pixel belongs to the tumour, I set the RGB value at this position to [1,0,0]
which results in an image where every pixel is either (0,0,1), (0,1,0) or (1,0,0).
Is that the correct way to do it or am I completely wrong?