haqishen / MFNet-pytorch

MFNet-pytorch, image semantic segmentation using RGB-Thermal images
114 stars 25 forks source link

Difference between code and paper fomula about classAvg #3

Closed SunnyWuYang closed 2 years ago

SunnyWuYang commented 3 years ago

I'm confused about conf[:,cid] = cf[:,cid]/cf[:,cid].sum() in calculate_result() function(util.py). In this paper and other papers, the definition of class accuracy is: $\frac{P{ii}}{\sum{j} P_{ij}$, in this way, the code should be conf[cid,:] = cf[cid,:]/cf[cid,:].sum()

yuxiangsun commented 3 years ago

I'm confused about conf[:,cid] = cf[:,cid]/cf[:,cid].sum() in calculate_result() function(util.py). In this paper and other papers, the definition of class accuracy is: $\frac{P{ii}}{\sum{j} P_{ij}$, in this way, the code should be conf[cid,:] = cf[cid,:]/cf[cid,:].sum()

You can refer to this repo for the metric code.

https://github.com/yuxiangsun/RTFNet/blob/master/util/util.py