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

TODO

  • pylint score >= 8.0
  • add Sphinx docs
  • add unit tests
  • add github actions for automated testing
  • add code coverage

References

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.3.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

poly2pascal-0.0.3-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: poly2pascal-0.0.3.tar.gz
  • Upload date:
  • Size: 5.9 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.3.tar.gz
Algorithm Hash digest
SHA256 f653baf2f7a3221fc975b3a69657b0b8ca94990ad533ead4d09bf0b0ff8d7f3b
MD5 f898fab6ce64d1a80e5369f591733117
BLAKE2b-256 9926b766a509ec6a53193f510e34ac9d1d028a8565008c2ea069ab722f8da7d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: poly2pascal-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7a952c50cd6d5a8c2d9cb7f7da6789170a6c9ee670e3279f9ce7abb0418f1222
MD5 bd7453663d8d516e65e495a1a6a1c9e5
BLAKE2b-256 aea918664a2bbf363acf1352180b7adff6e38062e5b244c24f12579beb78e3de

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