#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import os.path
import xml.etree.ElementTree as ET
import xml.dom.minidom as xdm
import sys
xml_path='/Users/chenhonghu/Downloads/data/xml/'
txt_path='/Users/chenhonghu/Downloads/data/txt/'
img_path='/work/traffic/data2/chenhonghu/tf-faster-rcnn-master/data/VOCdevkit2007/VOC2007/JPEGImages/'
f=open(os.path.join(txt_path, 'train.txt'), 'a')
xml_list=os.listdir(xml_path)
class_num={'car_region':'0', 'front_win':'1', 'rear_mirror':'2', 'wheel':'3',
'front_light':'4', 'car_logo':'5', 'car_head':'6', 'text':'7', 'rear_light':'8',
'trunk':'9', 'car_tail':'10', 'car_type_logo':'11', 'front_windsheild':&
python将pascal_voc xml转化为txt
最新推荐文章于 2024-01-08 09:59:51 发布
本文介绍如何使用Python将Pascal VOC XML格式的图像标注文件转换成简单的TXT格式,每行包含图片路径及物体的边界框坐标和类别编号。
摘要由CSDN通过智能技术生成