taming-transformers icon indicating copy to clipboard operation
taming-transformers copied to clipboard

Segmentation map palette

Open DenisSergeevitch opened this issue 4 years ago • 2 comments
trafficstars

Hi, thank you for sharing your amazing work. I want to play with it a bit and especially with my own segmentation maps, where I can find which color represents what material in the landscape model?

Here is an example of a segmentation map: download (1)

DenisSergeevitch avatar Jan 05 '21 13:01 DenisSergeevitch

The colors are actually just chosen randomly (you can see it either in the show_segmentation function defined in the notebook, or here). The model itself uses a one-hot encoding of class labels ranging from 0 to 181 as produced by the DeepLab v2 model. IIRC, these labels should correspond to this list shifted by one (i.e. index 0 corresponds to label person). To save and load them from disk, we use 8-bit grayscale pngs (as you probably saw in the other issue). You can find more details on how we did this in scripts/extract_segmentation.py. Let us know if you further questions!

pesser avatar Jan 11 '21 16:01 pesser

Good morning! I'm trying to play around with it in the notebook, but it's a little bit hard to understand how to produce the segmentation maps, maybe I'm missing something key here.

I tried upload a grayscale png made with photoshop, with a grey "level" corresponding to the list linked above (I tried both the number listed there and the number-1, as suggested), but still it outputs pretty random images... what's the best way to draw a segmentation in order to try it "artistically" speaking? Thank you!

Zorinik avatar Feb 16 '21 21:02 Zorinik