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
Multiclass segmentation #3
Comments
@JaledMC could you point me to where you see the labels being normalized between 0 and 1? |
Hello @JordanMakesMaps In the notebooks (thank to @karolzak for these useful scripts), you can see all steps needed for data preprocessing and training. If you go to Get data into correct shape, dtype and range (0.0-1.0), this two lines do normalization in both images (x), and labeled annotations (y):
In this way, pixel values go from 0 to 1 (max), and assign each pixel with its class (1, 2, 3 ...) can't be done. One solution could be use one hot encoding, but I don't know the filenames format for each mask. |
@JaledMC thanks, I forgot about the notebooks. Yeah I'm not sure about that, but I feel like it was just an error from copy and pasting code? I'm using the network, normalizing the images ([0, 1]), but one-hot-encoding the masks the same way I do with other architectures. This implementation works pretty good compared to others. |
Hi @JaledMC and @JordanMakesMaps It might be a good idea to prepare an example for multiclass segmentation as well.
It's just a matter of changing num_classes argument and you would need to shape your mask in a different way (layer per class??), so for multiclass segmentation you would need a mask of shape (width, height, num_classes) .
Let me know what you think and if that makes sense to you. |
Closing for now since there no activity happening for 2 weeks |
@karolzak, so you train multiple models individually, one for each class? When you perform predictions on images with multiple classes present, do you just save the prediction from each model and combine them overall? Can you load multiple models into memory at once? |
@JordanMakesMaps , yes, that's more or less how I'm doing it.
Yes you can. The problem with keras is that by default it holds a global session, so when you're working with multiple models at once you need to make sure that you're using separate sessions and models on different graphs. |
Hello @karolzak ,
Thanks for this great repo. In Customizable U-Net, it seems like multiclass segmentation can be done. But, what is the proper dataset format? With one hot encoding, one ground mask image per class for each example is needed. There is another way, assign each pixel its class (1, 2, 3, ...). But you use normalization to force label values between 0 and 1.
Could you provide some insight about this, please?
The text was updated successfully, but these errors were encountered: