Darknet: Bounding boxes for multiple images using python script

Created on 3 Mar 2018  路  1Comment  路  Source: pjreddie/darknet

I wrote a python script to get the co-ordinates of the objects in the images, but I am unable to draw bounding boxes using opencv. Does anybody have sample python script for doing it using opencv2? Or please direct me to which function does it in YOLO source code, so that I can use it as reference.

Here is my code if you want to check it out:
https://github.com/sowmyadvn/Illegal-Dumping-Detection/blob/master/detector_cv2.py

Thanks

Most helpful comment

I was able to solve it using cv2 library's putText and rectangle functions.

Eg:

cv2.rectangle(image_cv2,(x_min,y_min-24), (x_min+40,y_min),chart_colors[i],-1)
cv2.putText(image_cv2,name,(x_min,y_min-12), font, 0.5,(0,0,0),1,cv2.LINE_AA)

>All comments

I was able to solve it using cv2 library's putText and rectangle functions.

Eg:

cv2.rectangle(image_cv2,(x_min,y_min-24), (x_min+40,y_min),chart_colors[i],-1)
cv2.putText(image_cv2,name,(x_min,y_min-12), font, 0.5,(0,0,0),1,cv2.LINE_AA)
Was this page helpful?
0 / 5 - 0 ratings