Skip to content
Snippets Groups Projects
Commit 600b3089 authored by Jean-Luc Parouty's avatar Jean-Luc Parouty
Browse files

Add support for h5py dataset format

parent 3f9304f3
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -98,7 +98,7 @@ def plot_images(x,y, indices, columns=12, x_size=1, y_size=1, colorbar=False, y_ ...@@ -98,7 +98,7 @@ def plot_images(x,y, indices, columns=12, x_size=1, y_size=1, colorbar=False, y_
""" """
Show some images in a grid, with legends Show some images in a grid, with legends
args: args:
X: images X: images - Shapes must be (-1 lx,ly,1) or (-1 lx,ly,3)
y: real classes y: real classes
indices: indices of images to show indices: indices of images to show
columns: number of columns (12) columns: number of columns (12)
...@@ -118,8 +118,12 @@ def plot_images(x,y, indices, columns=12, x_size=1, y_size=1, colorbar=False, y_ ...@@ -118,8 +118,12 @@ def plot_images(x,y, indices, columns=12, x_size=1, y_size=1, colorbar=False, y_
for i in indices: for i in indices:
axs=fig.add_subplot(rows, columns, n) axs=fig.add_subplot(rows, columns, n)
n+=1 n+=1
img=axs.imshow(x[i],cmap = cm, interpolation='lanczos') # Shapes must be differents for RGB and L
img=axs.imshow(x[i],cmap = cm) (lx,ly,lz)=x[i].shape
if lz==1:
img=axs.imshow(x[i].reshape(lx,ly), cmap = cm, interpolation='lanczos')
else:
img=axs.imshow(x[i].reshape(lx,ly,lz),cmap = cm, interpolation='lanczos')
axs.spines['right'].set_visible(True) axs.spines['right'].set_visible(True)
axs.spines['left'].set_visible(True) axs.spines['left'].set_visible(True)
axs.spines['top'].set_visible(True) axs.spines['top'].set_visible(True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment