Skip to main content

No project description provided

Project description

xml2arr

Extract bounding boxes from XML format.

Instalation

pip install xml2arr

Usage

from xml2arr import extract, extract_to_file

XML_PATH = "/path/to/xml/exmaple.xml"

# Result as a python list
result = extract(XML_PATH)

# Saved to output file
OUT_PATH = "/path/to/output"
extract_to_file(XML_PATH, OUT_PATH)

Input

XML structure:

<annotation>
	<folder>painted_nails</folder>
	<filename>n3.png</filename>
	<path>C:/Users/username/img/n3.png</path>
	<source>
		<database>Unknown</database>
	</source>
	<size>
		<width>0</width>
		<height>0</height>
		<depth>3</depth>
	</size>
	<segmented>0</segmented>
	<object>
		<name>no</name>
		<pose>Unspecified</pose>
		<truncated>0</truncated>
		<difficult>0</difficult>
		<bndbox>
			<xmin>46</xmin>
			<ymin>294</ymin>
			<xmax>354</xmax>
			<ymax>718</ymax>
		</bndbox>
	</object>
<annotation>

Output

Expected output, can be saved to file or returned as a list:

[[46, 294, 354, 718]]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xml2arr-0.1.2.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xml2arr-0.1.2-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file xml2arr-0.1.2.tar.gz.

File metadata

  • Download URL: xml2arr-0.1.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for xml2arr-0.1.2.tar.gz
Algorithm Hash digest
SHA256 572f37da55360950ba42d7d9830856dd76c765e4884b12ac9d8a943fbc92c924
MD5 62161abcdf886dc89366ad687a279e59
BLAKE2b-256 1d6524cc964ebbbaf2bc913d5fed30b6546bc2aa73ffbfd23433140edbcef9ef

See more details on using hashes here.

File details

Details for the file xml2arr-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: xml2arr-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for xml2arr-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9c25dca564c3382acedcf9ffa7b887a745c19022809f23d05f40f286e7af081f
MD5 b2cdada394579c2c2a64acc4cabf29b4
BLAKE2b-256 4778464a6dd0dc17d84f66ca6b097b5a9ec041eae0ea7a5c32ddec62df353e1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page