Open ChrisGoettfert opened 3 years ago
It's very easy,you can do that simply by change one sentence in detect.py. change line 110 "label = '%s' % (names[int(cls)])"to this: label = '%s%.3f' % (names[int(cls)],conf.item()) Then it will show the confidence.The number 3 can be changed acccoding to your needs.
if you want 0.95,change number 3 to 2
@ChrisGoettfert
Hey @Jack-Hu-2001,
It worked like a charm! Thank you very much!
Hey,
The inferences of my model only show the name of the Class but not the confidence. Confidence for me is neither displayed anywhere.
From Yolov5, YoloR etc. confidence was always in the picture, but for ScaledYolov4 it is not the case.
I use the following command:
!python detect.py --weights ./runs/exp0_yolov4-csp-results/weights/best_yolov4-csp-results.pt --img 416 --conf 0.4 --source ../test/images
this would be the result:
this is how I want it to be (from YOLOv5):