How to read confidence in classification?

For single image classification, inference print confidence to console. I like to use confidence in my program. So how can I read the confidence to my program after inference?

Hi batu,
Current release have not supported showing confidence score for each top_k class in inference result yet. See How can I train as unary classification in TLT?

Can I log the confidence to a file? Then I can read from the file? Single image inference has confidence output to console. Can I print to log file?

During the inference log, can you see similar line as below?

Current predictions: [[0.01346104 0.06986671 0.01300252 0.02348311 0.03231168 0.05912479
0.27588853 0.00847786 0.02060444 0.00560192 0.00739526 0.00758662
0.01668995 0.01754443 0.29776257 0.02832825 0.00525219 0.01012738
0.07145583 0.01603499]]

The max one is the confidence of this image.

Yes I see on console. Can I log to a file so that I can read from a file from and program for next level of decision? I can’t read by my program from console.

You can write the log into a file.
For example

tlt-infer classification -m xxx.tlt -k $KEY -b 32 -i $TEST_IMAGE -cm classmap.json 2>&1 |tee log.txt