Skip to main content

Convert POLYGON bounding boxes from .csv files to .xml annotation files in the Pascal VOC format for computer vision projects.

Project description

p2p Logo

Install PyPI API docs GitHub contributors GitHub last commit GitHub forks GitHub stars GitHub license

poly2pascal

Convert POLYGON bounding boxes from .csv files to .xml annotation files in the Pascal VOC format for computer vision projects. Read the package documentation here.

Installation

Install poly2pascal with pip

  pip install poly2pascal

Usage

See the example notebook for more details. Here are the essentials of how to use this package:

# import annotator
from poly2pascal.annotations import XMLAnnotator

# create annotator
xmla = XMLAnnotator(
    images_path="path/to/images", 
    csv_file_path="path/to/csv/file.csv", 
    image_name_col="<image_name_column>",
    image_label_col="<object_label_column>", 
    xml_output_path="path/to/xml/annotation/output"
)

# create xml annotation files in Pascal VOC format
xmla.get_all_xml_annotations(img_format=".jpg")

Required Data Format

This package requires a .csv file with the following format of images and polygon annotations. These will be converted to .xml annotation files in the Pascal VOC format:

image_name object_label geometry
img_01.jpg cat POLYGON ((2478.89 156.77, 2478.89 297.86, 2377.97 297.86, 2377.97 156.77, 2478.89 156.77))
img_02.jpg cat POLYGON ((939.81 1221.46, 939.81 1319.68, 715.39 1319.68, 715.39 1221.46, 939.81 1221.46))
img_03.jpg dog POLYGON ((1559.7 1558.06, 1559.7 1966.3, 1129.73 1966.3, 1129.73 1558.06, 1559.7 1558.06))

Licence

Authors

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

poly2pascal-0.0.4.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

poly2pascal-0.0.4-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file poly2pascal-0.0.4.tar.gz.

File metadata

  • Download URL: poly2pascal-0.0.4.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for poly2pascal-0.0.4.tar.gz
Algorithm Hash digest
SHA256 d74a5078d9a9f0460fd862b0f5e6041d8d20acbf429a220cb2ec873cd4ef2f8b
MD5 94d2f3052cdecdd4262f524071f2f1f0
BLAKE2b-256 a0fa3bb05387d28c5176bfbabb5a7f9cce18396e01b9f6e7bf53e732cc71a4b1

See more details on using hashes here.

File details

Details for the file poly2pascal-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: poly2pascal-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for poly2pascal-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 04cdada9ec2bb720c441b7d0eb91a515b2671e3190898d395d87c9bbdcf11403
MD5 5ef59f477f3bec74cd5b945cb01c3296
BLAKE2b-256 d95190f18874e4e66b6449bea6555040dd38df4f7ddbb60c065e3bafce143ae9

See more details on using hashes here.

Supported by

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