cnn_olivettifaces.py 文件源码

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

项目:learning-tensorflow 作者: Salon-sai 项目源码 文件源码
def plot(error_index, dataset_path):
    img = mpimg.imread(dataset_path)
    plt.imshow(img)
    currentAxis = plt.gca()
    for index in error_index:
        row = index // 2
        column = index % 2
        currentAxis.add_patch(
            patches.Rectangle(
                xy=(
                     47 * 9 if column == 0 else 47 * 19,
                     row * 57
                    ),
                width=47,
                height=57,
                linewidth=1,
                edgecolor='r',
                facecolor='none'
            )
    )
    fig = plt.gcf()
    fig.set_size_inches(11.40, 9.42)
    plt.savefig("fig_result.png", bbox_inches="tight", dpi=100)
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号