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.1.tar.gz (6.2 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.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xml2arr-0.1.1.tar.gz
  • Upload date:
  • Size: 6.2 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.1.tar.gz
Algorithm Hash digest
SHA256 52633c8c4925e20e333f25790e7f7128f2c87ba065fd158498e4e9d56b15dde9
MD5 4c83cf154c1ba44ba2730743efef91a5
BLAKE2b-256 b3f038cba6e7bb743d3984c24957d26bfdead1fd4a6d76039b450661f152c7de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xml2arr-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc83f02ea6be6c970300b70bff22763904b2da1a8c84bed0ff791c25fdae3849
MD5 46bcd2e66f7a83c7736379cf1a81d7fe
BLAKE2b-256 3b688a65a239c3aa7782048d0dec4331216c7779fbf68a06df83209f22a15358

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