vis_imdb.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:py-faster-rcnn-resnet-imagenet 作者: tianzhi0549 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号