generative-compression icon indicating copy to clipboard operation
generative-compression copied to clipboard

How to generate the required HDF5 file?

Open davidyang19971209 opened this issue 4 years ago • 2 comments

This is my first use HDF5 dataset in neural network and I am clueless about how to generate the file with required format. Could anyone offer a example code about it?

davidyang19971209 avatar May 20 '21 01:05 davidyang19971209

import glob import os import pandas as pd

img_path = 'testB' #图片路径

i_paths = glob.glob(os.path.join(img_path,'*.jpg')) i_paths.sort() a = {'semantic_map_paths': i_paths} df = pd.DataFrame(data=a) #生成dataframe

#print(df) #df.to_hdf('underwater_paths_test.h5',key='trainB') #转存为h5文件 f = pd.read_hdf('underwater_paths_train.h5',key='semantic_map_paths') print(f)

JimmyWooo avatar May 22 '21 21:05 JimmyWooo

import glob import os import pandas as pd

img_path = 'testB' #图片路径

i_paths = glob.glob(os.path.join(img_path,'*.jpg')) i_paths.sort() a = {'semantic_map_paths': i_paths} df = pd.DataFrame(data=a) #生成dataframe

#print(df) #df.to_hdf('underwater_paths_test.h5',key='trainB') #转存为h5文件 f = pd.read_hdf('underwater_paths_train.h5',key='semantic_map_paths') print(f)

Thanks a lot, it is a great help to me

davidyang19971209 avatar May 24 '21 01:05 davidyang19971209