plot.py 文件源码

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

项目:unrolled-gan 作者: musyoku 项目源码 文件源码
def tile_binary_images(x, dir=None, filename="x", row=10, col=10):
    if dir is None:
        raise Exception()
    try:
        os.mkdir(dir)
    except:
        pass
    fig = pylab.gcf()
    fig.set_size_inches(col * 2, row * 2)
    pylab.clf()
    pylab.gray()
    for m in range(row * col):
        pylab.subplot(row, col, m + 1)
        pylab.imshow(np.clip(x[m], 0, 1), interpolation="none")
        pylab.axis("off")
    pylab.savefig("{}/{}.png".format(dir, filename))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号