Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate the required HDF5 file? #41

Open
davidyang19971209 opened this issue May 20, 2021 · 2 comments
Open

How to generate the required HDF5 file? #41

davidyang19971209 opened this issue May 20, 2021 · 2 comments

Comments

@davidyang19971209
Copy link

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?

@JimmyWooo
Copy link

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)

@davidyang19971209
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants