有这么个需求是将xml内容
1,filename
2.label
3.bndboxxmin,xmax,ymin,ymax

将这些东西写入excel表格中,方便我统计标签数量和框的分布!

于是撰写了脚本xml2csv.py
我的xml文件形式如下。大家目标检测格式大同小异!

<annotation>
	<folder>UAV_data</folder>
	<filename&gt;0_6326681_136.jpg</filename&gt;
	<source&gt;
		<database&gt;The UAV autolanding</database>
		<annotation>UAV AutoLanding</annotation>
		<image>flickr</image>
		<flickrid>NULL</flickrid>
	</source>
	<owner>
		<flickrid>NULL</flickrid>
		<name>ChaojieZhu</name>
	</owner>
	<size>
		<width>512</width>
		<height>512</height>
		<depth>3</depth>
	</size>
		<segmented>0</segmented>
	<object>
		<name>dog</name>
		<pose>Unspecified</pose>
		<truncated>1</truncated>
		&amp;

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注