Open 0ttwhy4 opened 8 months ago
Never mind.Already solved : )
@0ttwhy4 Hello, how do you get the confidence of the segmentation results to filter out some predictions that do not meet the conditions.
Assume there are 2 classes, the following can save the probabilities of each class and the classification result in csv files (you can also directly use the intermediate variables to do other things): model = init_model(cfg, checkpoint_file, 'cuda:0') result = inference_model(model, image)
np.savetxt('logits0.csv', result.seg_logits.data[0].to('cpu').numpy(), delimiter=',')
np.savetxt('logits1.csv', result.seg_logits.data[1].to('cpu').numpy(), delimiter=',')
np.savetxt('pred.csv', result.pred_sem_seg.data[0].to('cpu').numpy(), delimiter=',')
@changwsh12 Ok, got it. Thank you for your answer
I am trying to use pretrained models in mmseg to obtain a certain class of objects in images,which will serve as ground truth in my own model'training,and thus I want the result to be as accurate as possible by screening out pixels with low confidence.So how should I do it?:|