Hi,
I have a 1000x1000 image and a mask of the same size with 5 color-coded classes (blue, red, dark green, light green, and pink).

image1106×703 34.4 KB

I extracted this snippet of my code onto Jupyter notebook for debugging.
As we see below, the image shape is (1000, 1000, 3) and same thing for the mask shape. Yet len(colors) is 3809 instead of 5. Therefore my color map has 3809 key-value pairs instead of 5. Any reason why this might be happening?

image1100×186 6.76 KB

Thank you!