Skip to content

Commit

Permalink
Fix fence(IoU) = 0 when training on PascalContextDataset59;
Browse files Browse the repository at this point in the history
  • Loading branch information
sennnnn committed Apr 11, 2021
1 parent e0e985f commit 2cffeaf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mmseg/core/evaluation/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def intersect_and_union(pred_label,

intersect = pred_label[pred_label == label]
area_intersect = torch.histc(
intersect.float(), bins=(num_classes), min=0, max=num_classes)
intersect.float(), bins=(num_classes), min=0, max=num_classes - 1)
area_pred_label = torch.histc(
pred_label.float(), bins=(num_classes), min=0, max=num_classes)
pred_label.float(), bins=(num_classes), min=0, max=num_classes - 1)
area_label = torch.histc(
label.float(), bins=(num_classes), min=0, max=num_classes)
label.float(), bins=(num_classes), min=0, max=num_classes - 1)
area_union = area_pred_label + area_label - area_intersect
return area_intersect, area_union, area_pred_label, area_label

Expand Down

0 comments on commit 2cffeaf

Please sign in to comment.