Convert POLYGON bounding boxes from .csv files to .xml annotation files in the Pascal VOC format for computer vision projects.
Project description
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
Built Distribution
File details
Details for the file poly2pascal-0.0.2.tar.gz
.
File metadata
- Download URL: poly2pascal-0.0.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 443519cdc88317855c9c83b670f80fdf6bbd9acc2b7bce10bc9e3cab8c52f9bf |
|
MD5 | 41778f0baf8c06c8be695ec7cb71324c |
|
BLAKE2b-256 | 6a344011625a2c6eb2769558c4153b8e6e2fd32309b978f79fccf46aa7cc157f |
File details
Details for the file poly2pascal-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: poly2pascal-0.0.2-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4b8ab5bc5be641d4e00dfef3e4eacd0d9091c3231cd3fa4ff7618dc0f1dc513 |
|
MD5 | 5c65968da328992ef832fb8b9c732ab2 |
|
BLAKE2b-256 | 40ef3c92e4723a6526cb41df92e0e488fa422f627656aac48c93232e019e8837 |