LLaVA / utils /change_format.py
starriver030515's picture
Upload folder using huggingface_hub
bd4d522 verified
import json
with open("/mnt/petrelfs/zhuchenglin/clipscore/coco_gen_200k copy.json", "r") as f:
data = json.load(f)
# Convert the data to a list of dictionaries
data = [{"id": key, "clipscore": value["CLIPScore"]} for key, value in data.items()]
# Save the modified data
with open("/mnt/petrelfs/zhuchenglin/clipscore/coco_gen_200k.json", "w") as f:
json.dump(data, f)