# 加载数据成字典(读) with open(annotations_file, "r") as fa: annotations = json.load(fa)
# 上载数据成序列(写) with open("annotation/train_annotation.json", 'w') as fp: json.dump(annotations, fp, indent=4, separators=(',', ': '))