def build_colormap2label():
    'Build a RGB color to label mapping for segmentation.'
    colormap2label = np.zeros((256 ** 3))
    for (i, colormap) in enumerate(VOC_COLORMAP):
        colormap2label[((((colormap[0] * 256) + colormap[1]) * 256) + colormap[2])] = i
    return colormap2label
Build a RGB color to label mapping for segmentation.
def build_colormap2label():
    
    colormap2label = np.zeros((256 ** 3))
    for (i, colormap) in enumerate(VOC_COLORMAP):
        colormap2label[((((colormap[0] * 256) + colormap[1]) * 256) + colormap[2])] = i
    return colormap2label