(CamVid)I still don't understand how to load the label for CamVid

On lesson free, it labels the objects in picture pixel by pixel in the CamVid dataset. But I still do not understand how load the label to put them into the picture?


Each pixel in the numpy array (the mask) represents a class. So IE if we have a 4x4 image, with three classes with the following setup:

0 = ‘background’
1 = ‘cat’
2 = ‘bird’

2201
2001
0011
0011

This would mean that in our “image”, the top left corner has a cat and the right/bottom right side has a bird. Does this help a bit?

I still do not understand what 2201, 2001, 0011,011 mean.
They don’t even have information about position.
In addition, what does 0001TP_006690.png mean?

Think of them as the individual pixels in the image. Pixel at 0,3 has a value of 2, which is a bird. They’re “masks”. The png is the file name. In this dataset the y’s (our masks) are named similar to the original file name

So you are saying “0001TP_006690.png” does not tell the position and what item in the picture.

Oh, I see.
2201
2001
0011
0011

But the problem is which file says where the bird should be at?

No, it’s given a particular file, it has an associated mask (with a similar file name). This mask is just an array like the example 4x4 we saw, where each coordinate matches up to a particular class or object. Each point in this mask then has one of these overlay pixels. In our example, the 2’s in the top corner means those 3 pixels contain a bird, and the bottom corner and side contain a cat, as bird is when a pixel value is 2, cat of 1, and the “background” or “nothing” as zero. Does this help?

A visual example of what these are is like so: the top is the original image, the bottom is it’s associated mask file (which are two different things!)

Here yellow (which we’ll call pixel # 0) is giraffe, pixel 1 is ground, (dark blue), and pixel 2 is brush (light blue)

Thank You, I think I got it. The mask image has a pixel value that is the class name in number
Thank You for your help💖

Perfect! Yes! :slight_smile: