sepandhaghighi / pycm

Multi-class confusion matrix library in Python
http://pycm.io
MIT License
1.45k stars 124 forks source link

Jaccard Index vs IoU #436

Closed elliestath closed 2 years ago

elliestath commented 2 years ago

Description

Hey, it works like a charm, thanks! Question: If I am not wrong, there is no IoU score but only the Jaccard index which seems to be equivalent. Can you confirm this?

Thanks!

PyCM Version (Use : pycm.__version__)

pycm==3.4

sepandhaghighi commented 2 years ago

Hi

Yes, Jaccard index and Intersection-Over-Union (IoU) are equal (in classification metrics) Please, feel free to let me know if you require any further information.

elliestath commented 2 years ago

Thank you for the answer, very useful to clarify my doubt. I am performing a semantic segmentation task and would like to make sure I am using the correct metrics from your library. For now I do:

pixel accuracy: cm.ACC
precision: cm.PPV
recall: cm.TPR
F1-score: cm.F1
IoU: cm.J

does this sound right? Thank you very much, the library is awesome!

sepandhaghighi commented 2 years ago
pixel accuracy: cm.ACC 🆗 (For overall accuracy take a look at cm.Overall_ACC )
precision: cm.PPV 🆗
recall: cm.TPR 🆗
F1-score: cm.F1 🆗
IoU: cm.J 🆗