utils.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:Learning-to-navigate-without-a-map 作者: ToniRV 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号