def create_grid_8_dataset(mat_file_path, db_name, save_dir):
"""Convert grid 8x8 dataset from mat file to hdf5 format.
Parameters
----------
mat_file_path : str
the path to the mat file
db_name : str
the name of the dataset
save_dir : str
the directory of the output path (must exist)
"""
# load matlab data
mat_data = load_mat_data(mat_file_path)
print ("[MESSAGE] The Matlab data is loaded.")
# init HDF5 database
db = init_h5_db(db_name, save_dir)
# save dataset
for key in data_dict:
add_h5_ds(mat_data[key], key, db)
print ("[MESSAGE] Saved %s" % (key))
db.flush()
db.close()
print ("[MESSAGE] The grid 8x8 dataset is saved at %s" % (save_dir))
utils.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录