How can i show the pred_score of each class?? #1374
Unanswered
sinyoung-park
asked this question in
Q&A
Replies: 1 comment 14 replies
-
modify this section code https://github.com/open-mmlab/mmclassification/blob/fb16bdc6a25f96843f8fb97b02e45872c61dc566/mmcls/apis/inference.py#L84-L90 To:
|
Beta Was this translation helpful? Give feedback.
14 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, i'm study CNN to mmclassification in R.O.K. and i study mechainical eng.
i make CNN code in colab follow to mmclassification tutorial.
i make the inference model too.
but the inference model return to pred_label, pred_class, pred_score when i put in image file.
but, i want pred_score of each class.
my dataset is Customdataset.
my dataset num_classse is 5
there are my inference code.
from mmcls.apis import inference_model, init_model
import mmcv
load image
img = mmcv.imread('/content/mmclassification/pcldata/test_set/12slm/12slm1108.png')
initialize model
config_file = '/content/mmclassification/configs/resnet/resnet34_8xb32_in1k.py'
checkpoint_file = '/content/mmclassification/work_dirs/resnet34_8xb32_in1k/latest.pth'
model = init_model(config_file, checkpoint_file, device='cuda')
perform inference
result = inference_model(model, img)
print(result)
how can i fix?? please tell me the sloution..
Beta Was this translation helpful? Give feedback.
All reactions