likyoo / Siam-NestedUNet

The pytorch implementation for "SNUNet-CD: A Densely Connected Siamese Network for Change Detection of VHR Images"
MIT License
260 stars 60 forks source link

Assessment of metric prediction issues #8

Closed liudong315 closed 3 years ago

liudong315 commented 3 years ago

In the eval.py file, an error is reported, how should I fix it, thanks! image

likyoo commented 3 years ago

I think you can debug it and check the contents of the labels and cd_preds. Here is an official sample from sklearn:

>>> tn, fp, fn, tp = confusion_matrix([0, 1, 0, 1], [1, 1, 1, 0]).ravel()
>>> (tn, fp, fn, tp)
(0, 2, 1, 1)