Skip to main content

Labelbox Scripts

Usage

Setup

Tested against Python 3.6.4. To install to site-packages for use:

python setup.py install

Labelbox JSON to COCO

Convert a Labelbox JSON export file to COCO format.

# import labelbox2coco library
import labelbox2coco as lb2co

# set labeled_data to the file path of the Labelbox JSON export
labeled_data = 'test-fixtures/labelbox_1.json'

# set coco_output to the file name you want the COCO data to be written to
coco_output = 'lb2co_1.json'

# call the Labelbox to COCO conversion
lb2co.from_json(labeled_data=labeled_data, coco_output=coco_output)

Labelbox JSON to Pascal VOC

Convert a Labelbox JSON export file to Pascal VOC format.

# import labelbox2pascal library
import labelbox2pascal as lb2pa

# set labeled_data to the file path of the Labelbox JSON export
labeled_data = 'test-fixtures/labelbox_1.json'

# set ann_output_dir to the file path of the directory to write Pascal VOC
# annotation files. The directory must exist.
ann_output_dir = './Annotations'

# set images_output_dir to the file path of the directory to write images.
# The directory must exist.
images_output_dir = './Images'

# call the Labelbox to Pascal conversion
# NOTE: make sure to specify the correct label_format based on the export
#  format chosen on Labelbox; 'WKT' or 'XY'.
lb2pa.from_json(labeled_data=labeled_data, ann_output_dir=ann_output_dir,
                images_output_dir=images_output_dir, label_format='WKT')

Development

pipenv is used to manage virtualenvs and dependencies.

To get set up:

pipenv install --dev -e '.[dev]'

To run tests:

pipenv run pytest

To generate a requirements.txt for backwards compatibility:

pipenv lock -r --dev

Releasing

pipenv run python setup.py sdist bdist_wheel
twine upload 'dist/*'

Metadata

Release files for LBExporters 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for LBExporters 0.1.1
File Size Uploaded
LBExporters-0.1.1.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for LBExporters 0.1.1
File Interpreter ABI Platform
LBExporters-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / LBExporters-0.1.1.tar.gz

Download URL LBExporters-0.1.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
15b27641c297c5820a5a278d1acb46941a790a66e7eba2d08ae7a355fdd50bed
BLAKE2b-256 checksum
How to use checksums
a4c031eea0b4ee0773301a3abf3da0939d016c203b2003c9e35c34c703c13f0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

Release files / LBExporters-0.1.1-py3-none-any.whl

Download URL LBExporters-0.1.1-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9ca65ab0abacc9f604eb553ff9fc64eb21a8d703ea4b4913e2b32ba123e55f4
BLAKE2b-256 checksum
How to use checksums
5e1105eeb25c44d9aaa69c82eb2b42aaaf3674e49922189f4bfb39649fd37722
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page