File size: 316 Bytes
bf12bb2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import json
test_data = json.load(open("reformat_test.json", 'r'))
new_data = {}
for d in test_data:
# image1 = d["img0"]
# image2 = d["img1"]
# image_id = "%s_%s" % (image1, image2)
image_id = d["uid"]
new_data[image_id] = d["sents"]
json.dump(new_data, open("reformat_test_all.json", "w")) |