Skip to content

Commit

Permalink
Add prefix to output images
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycho7 committed Oct 25, 2017
1 parent 9778c7d commit a163f94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions autoencoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def get_weights_as_images(self, width, height, outdir='img/', max_images=10, mod
image_path = outdir + self.model_name + '-enc_weights_{}.png'.format(p)
utils.gen_image(enc_w, width, height, image_path)

def get_images(self, images, channel=3, width=32, height=32, outdir='img/', model_path=None):
def get_images(self, images, prefix, channel=3, width=32, height=32, outdir='img/', model_path=None):
assert channel in [1, 3]

outdir = self.data_dir + outdir
Expand All @@ -461,17 +461,17 @@ def get_images(self, images, channel=3, width=32, height=32, outdir='img/', mod
origin,
width,
height,
'%s%s-origin-%d.png' % (outdir, self.model_name, i),
'%s%s-%s-origin-%d.png' % (outdir, self.model_name, prefix, i),
image_type)
utils.gen_image(
corrupted,
width,
height,
'%s%s-corrupted-%d.png' % (outdir, self.model_name, i),
'%s%s-%s-corrupted-%d.png' % (outdir, self.model_name, prefix, i),
image_type)
utils.gen_image(
decoded,
width,
height,
'%s%s-decoded-%d.png' % (outdir, self.model_name, i),
'%s%s-%s-decoded-%d.png' % (outdir, self.model_name, prefix, i),
image_type)
4 changes: 2 additions & 2 deletions run_autoencoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
# dae.get_weights_as_images(28, 28, max_images=FLAGS.weight_images)
index = [1100, 2200, 3300, 4400, 5500, 6600, 7700]
trImg, teImg = [trX[index], teX[index]]
dae.get_images(trImg)
dae.get_images(teImg)
dae.get_images(trImg, "train")
dae.get_images(teImg, "test")


0 comments on commit a163f94

Please sign in to comment.