Skip to content
forked from isabek/XmlToTxt

ImageNet file xml format to Darknet text format

Notifications You must be signed in to change notification settings

astroCV/XmlToTxt

This branch is 17 commits behind isabek/XmlToTxt:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5c17c52 · Sep 21, 2017

History

8 Commits
Sep 13, 2017
Sep 13, 2017
Sep 13, 2017
Sep 13, 2017
Sep 21, 2017
Sep 13, 2017
Sep 13, 2017
Sep 13, 2017
Sep 13, 2017
Sep 13, 2017

Repository files navigation

XmlToTxt

ImageNet file xml format to Darknet text format.

Installation

sudo pip install -r requirements.txt

Usage

python xmltotxt.py -xml xml -out out

Example

Input xml file.

<annotation>
	<filename>image-0000016.jpg</filename>
	<size>
		<width>1920</width>
		<height>1080</height>
	</size>
	<object>
		<name>sedan</name>
		<bndbox>
			<xmin>75</xmin>
			<ymin>190</ymin>
			<xmax>125</xmax>
			<ymax>210</ymax>
		</bndbox>
	</object>
</annotation>

Output text file.

4 0.052083 0.185185 0.026042 0.018519

Motivation

I used Darknet for real-time object detection and classification. Sometimes you need to collect your own trainig dataset for train your model. I collected training dataset images and fine awesome tool for labeling images. But it generates xml files. So I needed to implement tool which translates from ImageNet xml format to Darknet text format.

About

ImageNet file xml format to Darknet text format

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%