Skip to content
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

Output class probabilites for segmetation tasks #338

Open
geoffreyjdawson opened this issue Dec 23, 2024 · 3 comments · May be fixed by #393
Open

Output class probabilites for segmetation tasks #338

geoffreyjdawson opened this issue Dec 23, 2024 · 3 comments · May be fixed by #393
Assignees
Labels

Comments

@geoffreyjdawson
Copy link
Member

Currently when we performing inference on a segmentation task we can only output the most probable class. It would be good to have an option to also output the probabilities for each class as separate bands i.e. not perform the argmax.

y_hat = y_hat.argmax(dim=1)

To do this would also mean that we would need an option for a multi-band output here

https://github.com/IBM/terratorch/blob/30dfdf15716edcc9295559aec4327dee62b0d956/terratorch/cli_tools.py#L87C1-L103C1

I have tried this and it works on a single tile, but not with tiled inference.

@Joao-L-S-Almeida
Copy link
Member

Is PR #393 solving your issue, @geoffreyjdawson ?
Is it something interesting to include this feature also for classification ?

@romeokienzler
Copy link
Collaborator

@geoffreyjdawson agreed to review by EOD

@geoffreyjdawson
Copy link
Member Author

I tested it and for the dataset I am using, the number of output channels is the size of the image (e.g. 512x512x512) instead of the number of classes (e.g. 2x215x512)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants