TobyPDE / FRRN

Full Resolution Residual Networks for Semantic Image Segmentation
MIT License
278 stars 93 forks source link

How to mapping ground truth from color to labelIds #14

Closed LemonAniLabs closed 7 years ago

LemonAniLabs commented 7 years ago

Hi @TobyPDE ,

I have some training data was labeled in color, I would like to transform color image to labelIds image for training. label.py have the mapping table, so I just using 'id' to replace [r,g,b] and save one channel to image. Is this make sense?

Any idea? Thanks.

TobyPDE commented 7 years ago

There are two possibilities:

  1. You perform the mapping offline and store the result in a numpy array. You can then use the generic data provider that receives two numpy arrays for images and targets.
  2. You write your own dataprovider that performs the mapping.

The code in label.py is only used for visualization.

LemonAniLabs commented 7 years ago

I mean using the 'label.id' is correct or not? I see in dltools/utility.py is mapping from label.trainId to color instead of label.Id So if I want to mapping color to label value, should map to trainId?

TobyPDE commented 7 years ago

The new code allows mapping from colors to ids if you use the C++ version of Chianti.