You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think when pred.sum()==0 and gt.sum()==0, the dice score should be 1.0, not 0.0, and when pred.sum()>0 and gt.sum()==0, the dice score should be calculated by taking the complement of the original pred and gt.
The text was updated successfully, but these errors were encountered:
Thanks for your work.
I have a question about the metric used in TransUNet. In the /TransUNet/trainer.py file, I found the metrics defined as follows:
def calculate_metric_percase(pred, gt):
pred[pred > 0] = 1
gt[gt > 0] = 1
if pred.sum() > 0 and gt.sum() > 0:
dice = medpy.metric.binary.dc(pred, gt)
hd95 = medpy.metric.binary.hd95(pred, gt)
return dice, hd95
elif pred.sum() > 0 and gt.sum() == 0:
return 1., 0.
else:
return 0., 0.
I think when pred.sum()==0 and gt.sum()==0, the dice score should be 1.0, not 0.0, and when pred.sum()>0 and gt.sum()==0, the dice score should be calculated by taking the complement of the original pred and gt.
The text was updated successfully, but these errors were encountered: