【发布时间】:2021-07-05 03:07:09
【问题描述】:
我已注释图像并保存在注释文件夹中。我需要转成yolov5格式。
annotations = [os.path.join('annotations', x) for x in os.listdir('/content/gdrive/My
Drive/annotations') if x[-3:] == "xml"]
现在注释有:
annotations/100_1_0_20170110183726390.xml
annotations/100_1_2_20170105174847679.xml
annotations/100_1_2_20170110182836729.xml
当我尝试:
for ann in tqdm(annotations):
info_dict = extract_info_from_xml(ann)
convert_to_yolov5(info_dict)
annotations = [os.path.join('annotations', x) for x in os.listdir('annotations') if x[-3:] == "txt"]
我得到:
FileNotFoundError: [Errno 2] No such file or directory:
'annotations/100_1_0_20170110183726390.xml'
【问题讨论】:
标签: python xml for-loop yolo annotate