MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / get_lmdb_sample_info

Method get_lmdb_sample_info

tools/data/ratio_dataset.py:176–184  ·  view source on GitHub ↗
(self, txn, index)

Source from the content-addressed store, hash-verified

174 return data
175
176 def get_lmdb_sample_info(self, txn, index):
177 label_key = 'label-%09d'.encode() % index
178 label = txn.get(label_key)
179 if label is None:
180 return None
181 label = label.decode('utf-8')
182 img_key = 'image-%09d'.encode() % index
183 imgbuf = txn.get(img_key)
184 return imgbuf, label
185
186 def __getitem__(self, properties):
187 img_width = properties[0]

Callers 1

__getitem__Method · 0.95

Calls 3

getMethod · 0.80
encodeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected