-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Masks format #51
Comments
As I see it, with only 0 and 1 in the masks, you only have 1 class: the class with the ones. For the kaggle dataset the class was 'car'. The zeros do not correspond to any class. But you could see the zeros as the class 'not a car' as well, so there would be 2 "classes". It just depends on how you define your classes and your problem. If you would have two types of objects to segment, you might have an additional id that correspond to 'nothing', here that id is 0. |
I now have two classes + background, my mask images have 3 values, 0 for background, 1 for the first class and 2 for the second class. however when I set n_classes to 2 this happens:
Not sure whad I should do |
You have to separate your target masks into 2 layers with values 0 or 1 (black and white). So you would have a target tensor with 2 channels:
After this processing your mask tensor should be HxWxC, with C=2 for you. |
ah I see, so I did understand it correctly at the beginning
Thank you |
I am trying to use this to train on my own dataset. I couldn't figure out a way to access the data on kaggle without having to download the 24Gb zips. How are the GIF files formed?
In my data I currently have maks with class id's coded into them. I have two classes so my mask is a single channel image with 1's and 0's. But from the error I get when I start the training, it seems that I need a multichannel image with a channel for each class, can you confirm that?
EDIT:
I just set n_classes to 1 instead of 2 and it worked. Can you clarify why for classes 0 and 1 n_classes has to be set to 1?
The text was updated successfully, but these errors were encountered: