Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confidence threshold #3528

Open
0ttwhy4 opened this issue Jan 20, 2024 · 4 comments
Open

Confidence threshold #3528

0ttwhy4 opened this issue Jan 20, 2024 · 4 comments

Comments

@0ttwhy4
Copy link

0ttwhy4 commented Jan 20, 2024

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?:|

@0ttwhy4
Copy link
Author

0ttwhy4 commented Jan 21, 2024

Never mind.Already solved : )

@1wang11lijian1
Copy link

@0ttwhy4 Hello, how do you get the confidence of the segmentation results to filter out some predictions that do not meet the conditions.

@changwsh12
Copy link

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)

save the probabilities of the first class

np.savetxt('logits0.csv', result.seg_logits.data[0].to('cpu').numpy(), delimiter=',')

save the probabilities of the second class

np.savetxt('logits1.csv', result.seg_logits.data[1].to('cpu').numpy(), delimiter=',')

save the class number

np.savetxt('pred.csv', result.pred_sem_seg.data[0].to('cpu').numpy(), delimiter=',')

@1wang11lijian1
Copy link

@changwsh12 Ok, got it. Thank you for your answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants