赞
踩
# coding=utf-8 import os import xml.dom.minidom import cv2 as cv def xml_to_txt(indir, outdir): os.chdir(indir) xmls = os.listdir('.') for i, file in enumerate(xmls): file_save = file.split('.')[0] + '.txt' file_txt = os.path.join(outdir, file_save) f_w = open(file_txt, 'w') # actual parsing DOMTree = xml.dom.minidom.parse(file) annotation = DOMTree.documentElement filename = annotation.getElementsByTagName("path")</
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。