How can I change the colors of results of show_results for segmentation problem


I am trying to change the colors of the output of show_results function in a segmented image. Could anyone please help me with this?

Thank you

1 Like

There’s a cmap parameter where you can pass in various matplotlib color map codes

Hello Zachary

Thanks for the reply. Can you please give me an example code? if I have three segmented labels, how can I map them to three different custom colors?

Thank you

I have never personally tried a custom color map, I’ve just used what they have available in matplotlib (as this is what it’s from, not fastai). The above links should help you some :slight_smile: