# 加载数据成字典(读)
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=(',', ': '))
2024-01-16 22:49:40
# 加载数据成字典(读)
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=(',', ': '))