You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
415 B

import os
import json
root = "Tusimple/"
lable_str = open("Tusimple/test_label.json", "r", encoding="utf8").readlines()
lable_json = [json.loads(line) for line in lable_str]
with open("{}/test_label.json".format(root), "w", encoding="utf8") as fp:
for label,s in zip(lable_json, lable_str):
path = root + label["raw_file"]
# print(path)
if os.path.exists(path):
fp.write(s)