只需要将xml转成txt格式即可。
import xml.etree.ElementTree as ET
import os
category_set = set()
category_dict = {
}
def xml2txt(xml_path):
# 解析XML文件
tree = ET.parse(xml_path)
root = tree.getroot()
# 获取width和height
width = int(root.find('size/width').text)
height = int(root.find('size/height').text)
# 提取object信息
objects = []
for obj in root