awesome-semantic-segmentation-pytorch
awesome-semantic-segmentation-pytorch copied to clipboard
About the per class IoU
Hello author! Thank you for your hard work. I have some questions about the calculation of per class IoU.
-
In the core/utils/score.py, the mIoU = area_inter / area_union. In this calculation method, how should I calculate the IoU of per class?
-
For the voc12-segmentation dataset, there are 21 classes. Should I remove the background class when calculating mIoU, does your calculation method take the background class into account?
-
When training the voc12-segmentation dataset, the background class number is 0, should I set ingore index = 0 in loss function(default is -1)?
I will be very grateful if you could give me a favor.
Hi, my opinion is as follows:
- The mean value was calculated in thie line,
IoU
contains the values of per class. - Both are ok, I have seen some articles comparing two mIoU at the same time (such as DRN). If your dataset is class-imbalance, I suggest to remove the background.
- In most cases, the background is not necessary to ignore for VOC datasets.