Skip to content

评价指标代码 #4

@Philo-github

Description

@Philo-github

您的代码

def calculate_metric_percase(pred, gt):
    pred[pred > 0] = 1
    gt[gt > 0] = 1
    if pred.sum() > 0 and gt.sum() > 0:
        dice = metric.binary.dc(pred, gt)
        hd95 = metric.binary.hd95(pred, gt)
        return dice, hd95
    elif pred.sum() > 0 and gt.sum() == 0:
        return 1, 0
    else:
        return 0, 0

在第二个分支中,当pred.sum() > 0 and gt.sum() == 0,dice应该是0吧,而不是1;并且经过统计,公共数据集中这种无栓塞的图片数量超过50%,如果都将这种情况认为是1的话,会大大拉高模型的评价指标啊,您认为嘞?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions