def draw_boxes(im, bboxes, is_display=True, color=None, caption="Image", wait=True):
"""
boxes: bounding boxes
"""
im=im.copy()
for box in bboxes:
if color==None:
if len(box)==5 or len(box)==9:
c=tuple(cm.jet([box[-1]])[0, 2::-1]*255)
else:
c=tuple(np.random.randint(0, 256, 3))
else:
c=color
cv2.rectangle(im, tuple(box[:2]), tuple(box[2:4]), c)
if is_display:
cv2.imshow(caption, im)
if wait:
cv2.waitKey(0)
return im
vis_imdb.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录