Skip to main content

Labelme2YOLO

PyPI - Version PyPI Downloads PYPI - Downloads

Labelme2YOLO efficiently converts LabelMe's JSON format to the YOLOv5 dataset format. It also supports YOLOv5/YOLOv8 segmentation datasets, making it simple to convert existing LabelMe segmentation datasets to YOLO format.

New Features

  • export data as yolo polygon annotation (for YOLOv5 & YOLOV8 segmentation)
  • Now you can choose the output format of the label text. The two available alternatives are polygon and bounding box(bbox).

Performance

Labelme2YOLO is implemented in Rust, which makes it significantly faster than equivalent Python implementations. In fact, it can be up to 100 times faster, allowing you to process large datasets more efficiently.

Installation

pip install labelme2yolo

Arguments

[LABEL_LIST]... Comma-separated list of labels in the dataset.

Options

-d, --json_dir <JSON_DIR> Directory containing LabelMe JSON files.

--val_size <VAL_SIZE> Proportion of the dataset to use for validation (between 0.0 and 1.0) [default: 0.2].

--test_size <TEST_SIZE> Proportion of the dataset to use for testing (between 0.0 and 1.0) [default: 0].

--output_format <OUTPUT_FORMAT> Output format for YOLO annotations: 'bbox' or 'polygon' [default: bbox] [aliases: format] [possible values: polygon, bbox].

--seed Seed for random shuffling [default: 42].

-h, --help Print help.

-V, --version Print version.

How to Use

1. Converting JSON files and splitting training, validation datasets

You may need to place all LabelMe JSON files under labelme_json_dir and then run the following command:

labelme2yolo --json_dir /path/to/labelme_json_dir/

This tool will generate dataset labels and images with YOLO format in different folders, such as

/path/to/labelme_json_dir/YOLODataset/labels/train/
/path/to/labelme_json_dir/YOLODataset/labels/val/
/path/to/labelme_json_dir/YOLODataset/images/train/
/path/to/labelme_json_dir/YOLODataset/images/val/
/path/to/labelme_json_dir/YOLODataset/dataset.yaml

2. Converting JSON files and splitting training, validation, and test datasets with --val_size and --test_size

You may need to place all LabelMe JSON files under labelme_json_dir and then run the following command:

labelme2yolo --json_dir /path/to/labelme_json_dir/ --val_size 0.15 --test_size 0.15

This tool will generate dataset labels and images with YOLO format in different folders, such as

/path/to/labelme_json_dir/YOLODataset/labels/train/
/path/to/labelme_json_dir/YOLODataset/labels/test/
/path/to/labelme_json_dir/YOLODataset/labels/val/
/path/to/labelme_json_dir/YOLODataset/images/train/
/path/to/labelme_json_dir/YOLODataset/images/test/
/path/to/labelme_json_dir/YOLODataset/images/val/
/path/to/labelme_json_dir/YOLODataset/dataset.yaml

How to build package/wheel

pip install maturin
maturin develop

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

labelme2yolo-0.3.0.tar.gz (39.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

labelme2yolo-0.3.0-py3-none-win_amd64.whl (2.8 MB view details)

Uploaded Python 3Windows x86-64

labelme2yolo-0.3.0-py3-none-win32.whl (2.6 MB view details)

Uploaded Python 3Windows x86

labelme2yolo-0.3.0-py3-none-musllinux_1_2_x86_64.whl (3.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

labelme2yolo-0.3.0-py3-none-musllinux_1_2_i686.whl (3.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

labelme2yolo-0.3.0-py3-none-musllinux_1_2_armv7l.whl (3.5 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

labelme2yolo-0.3.0-py3-none-musllinux_1_2_aarch64.whl (3.5 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

labelme2yolo-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

labelme2yolo-0.3.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390x

labelme2yolo-0.3.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (4.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

labelme2yolo-0.3.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (3.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

labelme2yolo-0.3.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

labelme2yolo-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

labelme2yolo-0.3.0-py3-none-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

labelme2yolo-0.3.0-py3-none-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file labelme2yolo-0.3.0.tar.gz.

File metadata

  • Download URL: labelme2yolo-0.3.0.tar.gz
  • Upload date:
  • Size: 39.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.3

File hashes

Hashes for labelme2yolo-0.3.0.tar.gz
Algorithm Hash digest
SHA256 41ce9e5e41872f2eda25984cdd156bed4e4b331d8111286c4b8cf55b0e14e837
MD5 7d7779edc1f096c6844522f0c5a3ffab
BLAKE2b-256 3f95a2430160c5941db4434644a61875dac4079f5207c7e6fb6944652f5d2c05

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9fe96509fdb948c53d1a24ef1496afd6a5e26436fb34efeed042bb1d3e70967a
MD5 5aa9b70f24e57a3fe270e87c12dc070a
BLAKE2b-256 bb1e247848c63a11f14c39dbee74c7b6b1347f23996da11041d55bf15ac4814f

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-win32.whl.

File metadata

  • Download URL: labelme2yolo-0.3.0-py3-none-win32.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.3

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 0a8163041acae28fd40c7af4aeabf4114a755f7796112af59294118826b0e125
MD5 64185771a0439d54718caa33dc0f8015
BLAKE2b-256 2a7aa405e65b21c3701c4ea205b373308d8cccaca38fae5e7315587bd6133a15

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 03e7a322c1d09f0bce0a9cfde540f4240a2a8a4a16995388b59927ec37181f0a
MD5 45b79607b27aca4c89d4fd01be5194aa
BLAKE2b-256 b80eedd2be52bd5e0ee651dd681e4328bb89d04510be49bd056a0647a38b5a6e

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 eb35c9bd652ce8e9d5f00eb51a1ea575b846c5429a46852936c8d02f12200c21
MD5 894f98884c073aca7bcf16f69dbbee58
BLAKE2b-256 f2cca3438c22ec1307baec46b949074991dca182df04f6d25c8914bb3a1b1474

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 840f3a1d17d0c0dc793ff7a11d56ba63eb74cd74605e8fb084b93f30733551cd
MD5 bb014493c8f7474f5cc5c418d1997c71
BLAKE2b-256 a561c82c8a14c2fe076ea35479615bde7c85c66ade9792ef1060426ac880379c

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0c048f035c6629434cfb14d37cee20e64782942ee49c9ee3e7af16124573068e
MD5 9089acf19d77b192edf12705d68b58bd
BLAKE2b-256 e7e5a90145de10bd45865656017ad67be55bfd2fc9c410f8de49e0584b912cf3

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40f3da921c4784a2919f1823362df10884f33484fe93dbf0154cf7e1357c3fed
MD5 e0195895ba6d3d79ab50bd47e0f80667
BLAKE2b-256 4b55fea330c063ee00805bc241460d628b1eff6f8709554711eb77f1555908bc

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 262491e1e931465cc984ea10e1f9bf4db7c9eac25b82af751aa9831526a82f0f
MD5 01a733eea6985396e10e9718a97239aa
BLAKE2b-256 14228ba182788dbb6c15830adce9c484de22009c009ff58f0e2ed74cda4496a6

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 ab25a32398a11c2af2b4bc0312687da6e22976a577052b9697cd6fba2e4fb537
MD5 9901d94be71d1f627a80af9c59cfcb7e
BLAKE2b-256 90cd0ce2ab8f2bd37ab7630ca50f40d7ca9fc01798eada8687beb0ee2162cecd

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 58253bf27dc6c3a452f8f73c3125652e9ab2c2f9833d9c81606c135f3c228fb5
MD5 58b1e24d571db4db1a2cbaf8468cc9d6
BLAKE2b-256 943f3cb74baa688ba88c4ff59054b425de006664227da4800c591d387f42b650

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 81c227044086a760d8b67389e95fec00d90fa881ce446fc172eddd586e998f3b
MD5 22eec42a2b09035dc4ed305a2d12dfbf
BLAKE2b-256 38bc254b2df30dc8ec7f3b711ab47017f882c46214fd5232ab869639517cb15b

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3ae75e605cfdd8f02133d58b6a5df48d98e573df9a126bb31bda3af1c0010f51
MD5 dd43feed38fd48769d7e33ae4de24995
BLAKE2b-256 e32e75889be370e4a9e050882f9a3a548da5ba759d0decfd719a0acb86d0f4fd

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34bbb35fe31b0b66604e55739f9350bea81a8fe8e410c5d053178a53af38ef0f
MD5 89e7be3fe8d025d1fd72bec8a753af9d
BLAKE2b-256 d59bb643d6b307ef1ad5fa4749022d9a202004532f9cfa4b8b19dba41b6bd165

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.3.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for labelme2yolo-0.3.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5910feee6674bcc859bc41f0fcb5cf71b5a63c75179006e8ab26350539d81863
MD5 b3de4150f918c1a287f9114ace88eaa8
BLAKE2b-256 41f942a7ca9a45c1bfcbc17bccecef03a66a6d1cee1729a1f032c9d589f56481

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.0

15 files

0.3.3

15 files

0.3.2

15 files

0.3.1

15 files

This release

0.3.0 This release

15 files

0.2.5

15 files

0.2.4

15 files

0.2.3

15 files

0.2.2

15 files

0.2.1

15 files

0.2.0

15 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.2

2 files

0.0.1

2 files

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