MCPcopy Create free account
hub / github.com/OpenMatch/UniVL-DR / load_caps

Function load_caps

CLIP-DPR/data.py:175–182  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

173 return data
174
175def load_caps(path):
176 data = {}
177 with open(path) as fin:
178 for line in fin:
179 example = json.loads(line.strip())
180 imgid = str(example['image_id'])
181 data[imgid] = example['caption']
182 return data
183

Callers 2

gen_embeddings.pyFile · 0.90
train.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected