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.1.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.1-py3-none-win_amd64.whl (2.8 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3Windows x86

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ i686

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

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

labelme2yolo-0.3.1-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.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390x

labelme2yolo-0.3.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (4.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

labelme2yolo-0.3.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

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

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

labelme2yolo-0.3.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for labelme2yolo-0.3.1.tar.gz
Algorithm Hash digest
SHA256 be7bdf100d33d50ad85cbdb92b265e23d11652ddd3844403efd4efa12499fe42
MD5 6642c98e5be24688e49fd5c8de74c173
BLAKE2b-256 09013a42b0dedda47538c628d2f39f5f547e2e9ab97174b6e9dd148b641c0d78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 c69121dfb71426288916798376e00253c46e44aa8f1a0c0ef06c0eca52158c39
MD5 117fa9f695ebd6bba2ae6ccdcfa24cd0
BLAKE2b-256 e2f84ff3262165fc9f3cbfb0e75a357bed519fb1fd235cbdab40b99515bc52e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: labelme2yolo-0.3.1-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.6

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 aca66d2a0f9e733b800245fb0719d6a3917d7d72ab0ae6270978876d47972f9c
MD5 e0eb2c9d5c9f82feb41b90ac97e66633
BLAKE2b-256 f714aecd890265b629748aeeecfcda00b36cce0bb2ab30d3ed95afd379b7798c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 894a8a0fe0278a5f88a075aeb76602d4ef56f8610127ad6ab7e67eda33b63492
MD5 18f38b9494e920681f767f76cc8c91ca
BLAKE2b-256 b290516a01da7848b15035e504adafb9fef19c16c14e32945de94d23ac6975f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 7e57a3e5ba6c89a2a2d431d11bb2c6de44ae34e60eae82d187a6ed20a1b025ff
MD5 3696b2ba396477b701fdc1e9bf116c04
BLAKE2b-256 360aff7ae88844f7b03b10b940332e8282d349560c806a8017c5b703b29ecef1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 18a0ff7c24838356fc2f5ad3f99bf10f83e16cd870ea9398df09921dc097c64a
MD5 793e4b04b17ed27e08de577d316019f8
BLAKE2b-256 4885f1de67f899343bcbecc793db0f4edf11c014de4baad80bb2f0974a8fb889

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 11560db57caf0ccc6c503105444e48ec6b8ff5aa2c1e7931c020a1ec06cb2280
MD5 70e4b6a792ed8b52ab89bce3778693bb
BLAKE2b-256 5e3268fd14849c640e5c69b5b3d76452af3e5807d80db32938b8c7473f4b3439

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 56cc63db1896cf5c730f5f49e0afccdf01fab4594b3982e2012894fd347f1b9c
MD5 dbd340a869815367d2e29778c098e9d2
BLAKE2b-256 a866164e7e6491aae97e52731f6e8ab52d3a28f9bd907ff6bfbde7dc4045fe4e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 26a8894d7825dab3015a9ce1d247a5518998918402894ee07ba81b9ed0d825bb
MD5 0a7822a402a9f19f29ebae3d76ed0692
BLAKE2b-256 6c73e1bdcac1f2878dbf76c93c06ae8dff7299623108e738cc1b98094cc582a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 2f85acced742f139ed3c6e9bd0aa060da45062f8184716c463f499c5dc40118b
MD5 f11a1da459a59fd602165ceeda59ffaa
BLAKE2b-256 329729ea56ae26c555e32cc03d27144454db210a76decbfc291746340496fd67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5494445c36f02895b5d7600723902b802cd86e437b0a8c60d7b44f9c53920be7
MD5 ff3840b15ac2bbe568e32cf8a84a3e5f
BLAKE2b-256 ef5a61b644745fc60d15b5ccee2ab58934ca196c56bde9f85371e31beaf7266f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 c12ea63f2a3c9e46fc06afc78c23a77935c282d3d5537e27795c49f8d31510ea
MD5 f0d3e17e87ecbd3a42a0d16b581b1ebf
BLAKE2b-256 f204a5ce528e10c78bf44ae9ede033a58959f2eb91663b9d31fb491647484790

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f8461d1974976f35e98d0c7075cb4e38b48b1e08dc7c78e07f6a0bcaf182ee1f
MD5 712d6c7b54cdfe2e80508efe42f35ad1
BLAKE2b-256 644343722dbd6497ef2cdfa07d54f01ff04471a5f0aba6db37620abaffc0946a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 df352e48039b48c21a548685b94c01e964624198638746be8e4e566801dca058
MD5 cd4b85e715dfdd790e45c4c1f822f388
BLAKE2b-256 12ccc48aea10ef316b86ddd9284a01147feb6f82856159916b23fbaf33f3a41f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for labelme2yolo-0.3.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9f19e6d17e22f36ab843229b79636d6b2102088258e0beed4cec0ba94270b5d1
MD5 0c0edd436788dd93209936afd56382b0
BLAKE2b-256 294e9a6036ff70543e2d5b1857f254c0f0ebef3528f9f9f3281a1e468ce9f797

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

This release

0.3.1 This release

15 files

0.3.0

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