How to get the iou of each class? #520
-
If i have 5 classes , i want to get the iou of each class , like the following code to get the acc of each class , how to use the torchmetrics.IoU ? |
Beta Was this translation helpful? Give feedback.
Answered by
SkafteNicki
Sep 21, 2021
Replies: 2 comments
-
Hi, by setting the reduction parameter you can achieve this: metric=IoU(num_classes=5, reduction='none')
target = torch.randint(0, 5, (10, 25, 25))
pred = torch.randint(0, 5, (10, 25, 25))
metric(pred, target)
tensor([0.1193, 0.1064, 0.1154, 0.1061, 0.1216]) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
SkafteNicki
-
@SkafteNicki from which module are you importing IoU, is this still valid?
please see #2152. I'd like to extract recall and precision for a given IoU threshold. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, by setting the reduction parameter you can achieve this: