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
Metadata
Release files for poly2pascal 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| poly2pascal-0.0.5.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| poly2pascal-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.3 kB
Release files / poly2pascal-0.0.5.tar.gz
| Download URL | poly2pascal-0.0.5.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55aaf820d3bd78b12df917a684debb1624056e35f9625aa6c10b4d1615ee4322
|
|
BLAKE2b-256 checksum How to use checksums |
f55bde086db22da599e404ef749ffa700972bcd801cf5aef58bfd81f87803eaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.13
|
Release files / poly2pascal-0.0.5-py3-none-any.whl
| Download URL | poly2pascal-0.0.5-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1637b4123642162175267af4a6043a2797b5f4796f6bfd37f21000b166d06ae
|
|
BLAKE2b-256 checksum How to use checksums |
485ec3a8e158f22693e475c72d019a5d6a54822fd0229b6a0c71e40e227341d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.13
|