MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / __init__

Method __init__

SwissArmyTransformer/sat/data_utils/datasets.py:23–38  ·  view source on GitHub ↗
(self, path, process_fn)

Source from the content-addressed store, hash-verified

21
22class LMDBDataset(Dataset):
23 def __init__(self, path, process_fn):
24 import lmdb
25 self.env = lmdb.open(
26 path,
27 max_readers=32,
28 readonly=True,
29 lock=False,
30 readahead=False,
31 meminit=False,
32 )
33 self.process_fn = process_fn
34 if not self.env:
35 raise IOError('Cannot open lmdb dataset', path)
36
37 with self.env.begin(write=False) as txn:
38 self.length = int(txn.get('length'.encode('utf-8')).decode('utf-8'))
39
40 def __len__(self):
41 return self.length

Callers

nothing calls this directly

Calls 3

getMethod · 0.80
decodeMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected