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

mIoU #1124

Closed
Lee-Akita opened this issue Jul 3, 2022 · 3 comments · Fixed by #1236
Closed

mIoU #1124

Lee-Akita opened this issue Jul 3, 2022 · 3 comments · Fixed by #1236
Labels
enhancement New feature or request

Comments

@Lee-Akita
Copy link

Where is the semantic segmentation mIou?

@Lee-Akita Lee-Akita added the enhancement New feature or request label Jul 3, 2022
@github-actions
Copy link

github-actions bot commented Jul 3, 2022

Hi! thanks for your contribution!, great first issue!

@YangLeiSX
Copy link

I think it is ok to use jaccard_index to calculate mIoU and IoU over each class in segmentation task.

My code for 5-classes segmentation is as below.

import torch
import torchmetrics

preds = torch.randn(2, 5, 128, 256)
target = torch.randint(5, (2, 128, 256))

miou = torchmetrics.functional.jaccard_index(preds, target, num_classes=5)
print(miou)
ious = torchmetrics.functional.jaccard_index(preds, target, num_classes=5, average=None)
print(ious)

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

Successfully merging a pull request may close this issue.

4 participants