def __init__(self, dirpath):
# Open LMDB environment in read-only mode
self._lmdb_env = lmdb.open(dirpath, readonly=True, max_dbs=NB_DBS)
# Open the default database(s) associated with the environment
self.data_db = self._lmdb_env.open_db(DATA_DB)
self.meta_db = self._lmdb_env.open_db(META_DB)
# Read the metadata
self.nb_samples = int(self.get_meta_str(NB_SAMPLES))
评论列表
文章目录