test_aux.py 文件源码

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

项目:tf-Faster-RCNN 作者: kevinjliang 项目源码 文件源码
def _plot_patch(ax, bbox, prob, class_name, color):
    """ Plot a rectangle (labeled with color, class_name, and prob) on the test image """

    # Calculate Bounding Box Rectangle and plot it
    height = bbox[3] - bbox[1]
    width = bbox[2] - bbox[0]
    rect = patches.Rectangle((bbox[0], bbox[1]), width, height, linewidth=2, edgecolor=color, facecolor='none')
    ax.add_patch(rect)

    # Add confidence prob and class text to box
    if prob is not None:
        ax.text(bbox[0], bbox[1] - 2,
                '{:s} {:.3f}'.format(class_name, prob),
                bbox=dict(facecolor=color, alpha=0.5),
                fontsize=8, color='white')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号