mmsegmentation icon indicating copy to clipboard operation
mmsegmentation copied to clipboard

Confidence Score associated with segmentation

Open rafaelagrc opened this issue 1 year ago • 0 comments

Hello,

I am wondering if there is a way to extract the confidence score associated with the predicted masks. I am aware that I can extract the logits (described below) and pass them through a softmax layer to get confidence for each pixel, but I get very low values. Do you suggest any other way?

model = init_model(cfg, checkpoint_file, 'cuda:0')
result = inference_model(model, image)

for i in range(len(classes)):
      seg_logits = result.seg_logits.data[i]
      prob = F.softmax(seg_logits, dim=1)

Thank you for your attention!

rafaelagrc avatar May 24 '24 11:05 rafaelagrc