How to generate the required HDF5 file?
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?
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)
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