test_colorlabel.py 文件源码

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

项目:FCN_train 作者: 315386775 项目源码 文件源码
def test_bg_and_color_cycle():
    image = np.zeros((1, 10))  # dummy image
    label = np.arange(10).reshape(1, -1)
    colors = [(1, 0, 0), (0, 0, 1)]
    bg_color = (0, 0, 0)
    rgb = label2rgb(label, image=image, bg_label=0, bg_color=bg_color,
                    colors=colors, alpha=1)
    assert_close(rgb[0, 0], bg_color)
    for pixel, color in zip(rgb[0, 1:], itertools.cycle(colors)):
        assert_close(pixel, color)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号