Skip to main content

Converters from Labelbox exports to other common foramts

Project description

# Labelbox Scripts

## Usage

### Setup

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

```sh
python setup.py install
```

### Labelbox JSON to COCO

Convert a Labelbox JSON export file to COCO format.

```python
# 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.

```python
# 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:

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

To run tests:

```sh
pipenv run pytest
```

To generate a `requirements.txt` for backwards compatibility:

```sh
pipenv lock -r --dev
```


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

LBExporters-0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

LBExporters-0.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file LBExporters-0.1.tar.gz.

File metadata

  • Download URL: LBExporters-0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for LBExporters-0.1.tar.gz
Algorithm Hash digest
SHA256 03a741ecaaf272483ece7b70cbda584691806c2b3753af319ce1cecb23758028
MD5 e00e91f45af7f8838c6d022208655afd
BLAKE2b-256 14ecb490e8aaed9b763bebeaa05cb7d47fce89f1d642e066c618c1e3be9deb26

See more details on using hashes here.

File details

Details for the file LBExporters-0.1-py3-none-any.whl.

File metadata

  • Download URL: LBExporters-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for LBExporters-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d6ca16b550aa70a7ae7189232e61a584259a3b07585c9ef8d252851e13d8fb6
MD5 1d2f4038953482fb8f09765a22e5ceca
BLAKE2b-256 e35f42519236f53ab407017f4c1a6e975bd9e2233c99daf125dce379fe78e194

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