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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file poly2pascal-0.0.5.tar.gz.
File metadata
- Download URL: poly2pascal-0.0.5.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55aaf820d3bd78b12df917a684debb1624056e35f9625aa6c10b4d1615ee4322
|
|
| MD5 |
115a5eb95997690063a7b3d1b796644d
|
|
| BLAKE2b-256 |
f55bde086db22da599e404ef749ffa700972bcd801cf5aef58bfd81f87803eaa
|
File details
Details for the file poly2pascal-0.0.5-py3-none-any.whl.
File metadata
- Download URL: poly2pascal-0.0.5-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1637b4123642162175267af4a6043a2797b5f4796f6bfd37f21000b166d06ae
|
|
| MD5 |
32de82ec83f54920d4bb8860e0cc6d9e
|
|
| BLAKE2b-256 |
485ec3a8e158f22693e475c72d019a5d6a54822fd0229b6a0c71e40e227341d8
|