示例#1
0
def save_image(image, path):
    """Save an image as a png file"""
    image = dcgan_utils.inverse_transform(image)
    m.imshow(image)
    png_writer = png.Writer(64, 64)
    with open(path, 'wb') as outfile:
        png_writer.write(outfile, 255 * image.reshape([64, -1]))
示例#2
0
def view_image(image, hparams):
    """Show the image"""
    image = dcgan_utils.inverse_transform(image)
    frame = plt.gca()
    frame.axes.get_xaxis().set_visible(False)
    frame.axes.get_yaxis().set_visible(False)
    frame = frame.imshow(image.reshape(hparams.image_shape))
示例#3
0
def save_image(image, path):
    """Save an image as a png file"""
    #    plt.figure()
    #    plt.imshow(255*image)
    #    plt.savefig(path)
    image = dcgan_utils.inverse_transform(image)
    #    image=(100*image+1)/2.
    png_writer = png.Writer(64, 64)
    with open(path, 'wb') as outfile:
        png_writer.write(outfile, 255 * image.reshape([64, -1]))
示例#4
0
def display_transform(image):
    image = dcgan_utils.inverse_transform(image)
    return image