Darkflow: Adding confidence next to bbox label

Created on 5 May 2017  ·  3Comments  ·  Source: thtrieu/darkflow

Can we add the confidence value next to each bbox label? Where can I find how to do it?

Most helpful comment

If you are wanting to draw the confidence on the output image you should be able to modify this line: https://github.com/thtrieu/darkflow/blob/22ac87a3cb1b585d62c5106aab2f203ead4b445f/darkflow/net/yolov2/test.py#L61

To the following:

cv2.putText(imgcv, mess + ("{0:.2f}".format(confidence)), (left, top - 12),

Let me know if that works for you. If you are using YOLOv1 just update the equivalent line for test.py in YOLOv1

All 3 comments

If you are wanting to draw the confidence on the output image you should be able to modify this line: https://github.com/thtrieu/darkflow/blob/22ac87a3cb1b585d62c5106aab2f203ead4b445f/darkflow/net/yolov2/test.py#L61

To the following:

cv2.putText(imgcv, mess + ("{0:.2f}".format(confidence)), (left, top - 12),

Let me know if that works for you. If you are using YOLOv1 just update the equivalent line for test.py in YOLOv1

@abagshaw Wow it's that simple. Thanks, I just tried it. Works great.
I also want the letter to be bolder and i wanna put a background behind the text like the original darknet. But i'll try figuring that out myself.
Thanks anw

With this new version, the file that you need to edit is not test.py but instead predict.py for new people wondering.

I think this should be an option for the flow command, not just something user need to adjust the code for. Something like --showConfidence, I guess.

Was this page helpful?
0 / 5 - 0 ratings