Skip to content

Commit

Permalink
Merge pull request #42 from ragavvenkatesan/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Ragav Venkatesan committed Mar 3, 2017
2 parents 57cdf7d + 2fbfd19 commit 8b827a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions yann/modules/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def save_images(imgs, prefix, is_color, verbose = 2):
X = curr_image.reshape((curr_image.shape[0],curr_image.shape[1] * \
curr_image.shape[2])),
img_shape = (curr_image.shape[1], curr_image.shape[2]),
tile_spacing = (2,2),
tile_shape = tile_shape ))
if len(I.shape) == 3:
raster.append(rgb2gray(I))
Expand All @@ -87,6 +88,7 @@ def save_images(imgs, prefix, is_color, verbose = 2):
X = curr_image.reshape((curr_image.shape[0],curr_image.shape[1] * \
curr_image.shape[2])),
img_shape = (curr_image.shape[1], curr_image.shape[2]),
tile_spacing = (2,2),
tile_shape = tile_shape )))
assert len(raster[i].shape) == 2
imsave(prefix + str(i) + ".jpg",raster[i], cmap = 'gray')
Expand All @@ -106,8 +108,8 @@ def save_images(imgs, prefix, is_color, verbose = 2):
remain_rows = np.ceil(tile_raster / remain)
tile_shape = (tile_raster + remain_rows, tile_raster)
tile_shape = (int(tile_shape[0]), int(tile_shape[1]))
raster.append(np.array(tile_raster_images(X = imgs, img_shape = (lt,lt),
tile_shape = tile_shape)))
raster.append(np.array(tile_raster_images(X = imgs, img_shape = (lt,lt),
tile_spacing = (2,2), tile_shape = tile_shape)))
is_color = False
imsave(prefix + "0.jpg",raster[0], cmap ='gray')
return raster
Expand Down

0 comments on commit 8b827a1

Please sign in to comment.