unet icon indicating copy to clipboard operation
unet copied to clipboard

Found "X" images belonging to 1 classes

Open farhanrw opened this issue 5 years ago • 3 comments

Firstly thanks for your code. My issue is I am trying to perform multiclass segmentation on my own data. The data is of satellite images. So I have prepared masks of 12 labels, which means the number of classes is 12. I have two questions. I have one mask per image, which has 12 unique colors as labels. Is that going to work? Or should I put one color as mask, and the rest as black and put per class images in separate directory.

My second question is why do I get this,

Found 10 images belonging to 1 classes. Found 30 images belonging to 1 classes. Found 30 images belonging to 1 classes. Found 10 images belonging to 1 classes.

I would be grateful if you could help me out or give some pointers.

Thanks.

farhanrw avatar Apr 28 '19 00:04 farhanrw

Your label images are ok , it's right. The print information is keras's log information.

wuyang0329 avatar Apr 28 '19 08:04 wuyang0329

@farhanrw if you have a grayscale mask then it should be fine to have one number representing each class. But I'm not sure if we need to put class images in a seperate folder. I will try to put them separately and check the output. Anyway, have you got any reasonable output from the network?

Sam813 avatar Apr 28 '19 23:04 Sam813

Hi wuyang, thanks for your reply.

@Sam813 Hey Sam! At first it was not working at all. By that I mean, when I masked each the image using RGB colors of my own, say, Red for class A, blueish red for class B.... and on. So I had one colored mask image for one original image. This failed, the loss or accuracy was going nowhere.

Then I changed the mask. So i put R=1, G=1, B=1 for class A, R=2, G=2, B=2 for class B and so on. So the mask would be a very dark image. Then I trained and it worked.

farhanrw avatar Apr 29 '19 00:04 farhanrw