3

I'm saving a large dataset of images (flickr25k dataset) into hdf5 using h5py. However image are different in size, thus I can't create a dataset with shape (nb_images, height, width).

Now I'm using multiple datasets to handle this problem. Thus create_dataset('image1', shape=shape1) , create_dataset('image2', shape=shape2) , etc.

In python we can use a list to save multiple numpy.array with different size easily. I'm wondering if we can do the same thing with h5py, and fetch data with syntax like:

images = h5file.get('images')
images[id_img][:,:]
xiang0x48
  • 621
  • 6
  • 20
  • Search other `h5py` tagged questions. For example http://stackoverflow.com/q/41496953. `h5py` organizes groups and sets as dictionaries. – hpaulj Feb 23 '17 at 03:33
  • Thank you for your reply. I'm currently using method just like the example you mentioned. The reason I ask this question is that I'm just wondering if there is a grace method other than iterating all items or storing all keys into a list. – xiang0x48 Feb 23 '17 at 07:03

0 Answers0