LeeJunHyun / Image_Segmentation

Pytorch implementation of U-Net, R2U-Net, Attention U-Net, and Attention R2U-Net.
2.66k stars 594 forks source link

you can change TP and FN like this. TP = ((SR==1).byte()+(GT==1).byte())==2 .FN = ((SR==0).byte()+(GT==1).byte())==2. #63

Closed jiudawn closed 1 year ago

jiudawn commented 3 years ago

you can change TP and FN like this. TP = ((SR==1).byte()+(GT==1).byte())==2 .FN = ((SR==0).byte()+(GT==1).byte())==2.a1==

_Originally posted by @wellfrogliu in https://github.com/LeeJunHyun/Image_Segmentation/issues/58#issuecomment-664729127_

problem solved!

jiudawn commented 3 years ago

SP = float(torch.sum(TN))/(float(torch.sum(TN+FP)) + 1e-6) should also change "torch.sum(TN+FP)" to torch.sum(TN) + torch.sum(FP)

rgd66 commented 3 years ago

Hello! I can't get the score of JS and DC, JS=0, DC=0. How to solve this problem?

WAHSIM commented 3 years ago

Hello! I can't get the score of JS and DC, JS=0, DC=0. How to solve this problem?

you can change it this way. Inter=torch.sum((SR.byte()+GT.byte())==2). the rest can be done in the same manner.

lifuguan commented 3 years ago

Thanks!