MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / LMDBDataDecoder

Class LMDBDataDecoder

tensorpack/dataflow/format.py:158–169  ·  view source on GitHub ↗

Read a LMDB database with a custom decoder and produce decoded outputs.

Source from the content-addressed store, hash-verified

156
157
158class LMDBDataDecoder(MapData):
159 """ Read a LMDB database with a custom decoder and produce decoded outputs."""
160 def __init__(self, lmdb_data, decoder):
161 """
162 Args:
163 lmdb_data: a :class:`LMDBData` instance.
164 decoder (k,v -> dp | None): a function taking k, v and returning a datapoint,
165 or return None to discard.
166 """
167 def f(dp):
168 return decoder(dp[0], dp[1])
169 super(LMDBDataDecoder, self).__init__(lmdb_data, f)
170
171
172def CaffeLMDB(lmdb_path, shuffle=True, keys=None):

Callers 1

CaffeLMDBFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected