Search code examples
semantic-segmentationfast-ai

The mask codes appear different for same label in different images in fastai lesson 3-camvid.ipynb example. Is this an issue?


I'm trying the fastai example, lesson 3-camvid.ipynb, and there is a verification in the beginning of the example, about the images and labels. Where we can see the original image and a mask (ground thruth semantic segmentation) from that original image.

Example, image 150 from the camvid dataset:

img_f = fnames[150]
img = open_image(img_f)
img.show(figsize=(5,5))

enter image description here

get_y_fn = lambda x: path_lbl/f'{x.stem}_P{x.suffix}'
mask = open_mask(get_y_fn(img_f))
mask.show(figsize=(5,5), alpha=1)

enter image description here

But, if I change the image, for example to image 250 from the camvid dataset:

enter image description here

The mask label changes, eg. the road label has a different color from the previous image:

enter image description here

Apparently, it matters the order in which each label occurs on each image.

So, is this an issue? Is it something I should fix somehow?

Thanks in advance!


Solution

  • According to the official CamVid labels Road has to be the color as in the image 250.

    Camvid Class Labels

    You can leave the data set as it is, but if you looking for increasing model accuracy you can change the labels of the corresponding pixels. The Model is capable of identifying the road by other examples in data set.