voc2coco icon indicating copy to clipboard operation
voc2coco copied to clipboard

confused about how to use? your guide is too simple

Open nTnZone opened this issue 3 years ago • 0 comments

first I write this according to your guide: xml_list_path = os.path.join(sys.path[1],"dataset/label/annotation2021") convert("xmllist.txt", xml_list_path, "output.json") and raise a error:FileNotFoundError: [Errno 2] No such file or directory my xmllist contains all the xml file such as 000001.xml 000002.xml... and each line contains one filename

Second I want to understand your code for fix this error def convert(xml_list, xml_dir, json_file): list_fp = open(xml_list, 'r') json_dict = {"images":[], "type": "instances", "annotations": [], "categories": []} categories = PRE_DEFINE_CATEGORIES bnd_id = START_BOUNDING_BOX_ID for line in list_fp: line = line.strip() print("line:"+line) print("Processing %s"%(line)) xml_f = os.path.join(xml_dir, line) print("xml_f:"+xml_f) tree = ET.parse(xml_f) root = tree.getroot() print(type(root)) path = get(root, 'path') ....... what this 'path' mean? And this script

nTnZone avatar Apr 20 '21 13:04 nTnZone