-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
add class mapping for multi class segmentation #401
base: master
Are you sure you want to change the base?
Conversation
This doesn't seem to be working for me, at least using 3 channel pngs as masks |
how many classes do you have? you must ensure that you have mapped all classes, can you share the mapping dict you have set? |
I have removed /255 in preprocessing, I think it must be the cause of your issue, can you retry now? |
how do we need to arrange for mapping values if we have more than 3 classess? |
You must map each class color code to an index, for example: if you have 5 classes with the following colors: Black, blue, red, aqua, and magenta. the mapping dict must be: mapping = {(0, 0, 0): 0, (0, 0, 255): 1, (255, 0, 0): 2, (0, 255, 255): 3, (255, 0, 255): 4} |
Thank u so much for the quick reply. Mapping values worked for me for my custom dataset. I have another question when I load any mask from Carvana datasets. It shows 1280x1918 uint8. It is not 1280x1918x3. The intensity value of the car is 1 and the background is 0. In multi-class segmentation, the mask should has w,h,c. for ex: 1280x1918x3 uint8, and a blue label which represents car should have intensity value 0 in r, 0, g, 255 in blue channel. or for magenta channel red 255, green 0 and blue 255. Question2: why does data_loading.py only take the transpose of the images instead of both mask and images? Because code says "if it is not mask, it takes transpose ((2,0,1))"?, it gives me an error. Error: File "train.py", line 200, in Question 3: why did you remove /255? what will happen to the normalization? sorry for the long comment. I'm trying to understand. |
I didn't test the Carnava dataset, but if you are talking about the mask shape after mapping, it must be (h, w) and there will be no channel dim. |
Doesn't this operation create some kind of association between different classes? What if my classes have no relationship with each other? |
What should I do if my original mask is a four-channel image where each channel is a binary image? |
I am not 100 sure how to use more than 2 classes: |
No description provided.