Return coordinates that passes threshold value for bounding boxes Google's Object Detection API

北城余情 提交于 2019-12-02 07:02:48

Update: The boxes and scores returned by previous functions are both numpy array objects, therefore you can use boolean indexing to filter out boxes below the threshold.

This should give you the box that passes the threshold.

true_boxes = boxes[0][scores[0] > min_score_thresh]

And then you can do

for i in range(true_boxes.shape[0]):
    ymin = true_boxes[i,0]*height
    xmin = true_boxes[i,1]*width
    ymax = true_boxes[i,2]*height
    xmax = true_boxes[i,3]*width
    print ("Top left")
    print (xmin,ymin,)
    print ("Bottom right")
    print (xmax,ymax)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!