MCPcopy Create free account
hub / github.com/SooLab/CGFormer / _init_db

Method _init_db

utils/dataset.py:103–112  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

101 # self.coco_transforms = make_coco_transforms(mode, cautious=False)
102
103 def _init_db(self):
104 self.env = lmdb.open(self.lmdb_dir,
105 subdir=os.path.isdir(self.lmdb_dir),
106 readonly=True,
107 lock=False,
108 readahead=False,
109 meminit=False)
110 with self.env.begin(write=False) as txn:
111 self.length = loads_pyarrow(txn.get(b'__len__'))
112 self.keys = loads_pyarrow(txn.get(b'__keys__'))
113
114 def __len__(self):
115 return self.length

Callers 1

__getitem__Method · 0.95

Calls 1

loads_pyarrowFunction · 0.70

Tested by

no test coverage detected