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

--json_dir LabelMe JSON files folder path.

--val_size (Optional) Validation dataset size, for example 0.2 means 20% for validation.

--test_size (Optional) Test dataset size, for example 0.1 means 10% for Test.

--json_name (Optional) Convert single LabelMe JSON file.

--output_format (Optional) The output format of label.

--label_list (Optional) The pre-assigned category labels.

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

License

labelme2yolo is distributed under the terms of the MIT license.

Metadata

Release files for labelme2yolo 0.2.2

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

Source distribution (sdist)

Source distribution for labelme2yolo 0.2.2
File Size Uploaded
labelme2yolo-0.2.2.tar.gz 13.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for labelme2yolo 0.2.2
File
labelme2yolo-0.2.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
labelme2yolo-0.2.2-py3-none-win32.whl Python 3 none Windows x86-32 Details
labelme2yolo-0.2.2-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details
labelme2yolo-0.2.2-py3-none-musllinux_1_2_i686.whl Python 3 none Linux musl 1.2+ x86-32 Details
labelme2yolo-0.2.2-py3-none-musllinux_1_2_armv7l.whl Python 3 none Linux musl 1.2+ ARMv7l Details
labelme2yolo-0.2.2-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details
labelme2yolo-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
labelme2yolo-0.2.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl Python 3 none Linux glibc 2.17+ IBM System/390x Details
labelme2yolo-0.2.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl Python 3 none Linux glibc 2.17+ PowerPC 64-le Details
labelme2yolo-0.2.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl Python 3 none Linux glibc 2.17+ x86-32 Details
labelme2yolo-0.2.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl Python 3 none Linux glibc 2.17+ ARMv7l Details
labelme2yolo-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
labelme2yolo-0.2.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
labelme2yolo-0.2.2-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 18.1 MB

Release files / labelme2yolo-0.2.2.tar.gz

Download URL labelme2yolo-0.2.2.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5c9e9bfe654975ab02720697a8aac7b944ee1bdb1cd0216a576981c8c22ec9f0
BLAKE2b-256 checksum
How to use checksums
c1e077bf951487478fdf02ac026981d01fd2991860aa76dda558f2b5b2ca8f2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-win_amd64.whl

Download URL labelme2yolo-0.2.2-py3-none-win_amd64.whl
Size 1.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
f2b25590ac94f28000abed48258eaed1785bd1e2e67ea9de979d619737a16d62
BLAKE2b-256 checksum
How to use checksums
56a864d2c0593282353d9a2ba0e197f7701f5a9c146a8bfe255ce28e980ea6fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-win32.whl

Download URL labelme2yolo-0.2.2-py3-none-win32.whl
Size 954.1 kB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
7ab6f6c4ee96dbb3e124f368d9502cf1e4049bbc60ad939b0d74686d981dbfd6
BLAKE2b-256 checksum
How to use checksums
30ec74a39f36585221893f2015128f150df98dedba9c9bb582accdb72e0247d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-musllinux_1_2_x86_64.whl

Download URL labelme2yolo-0.2.2-py3-none-musllinux_1_2_x86_64.whl
Size 1.4 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
028606d347f20d981bbd597b9c4327fb7cb1a853b6ab04b993d5cf69f3cca342
BLAKE2b-256 checksum
How to use checksums
a6a944191333db6982b4e54762a8dd26734a587196bcc78466b038fe3849beb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-musllinux_1_2_i686.whl

Download URL labelme2yolo-0.2.2-py3-none-musllinux_1_2_i686.whl
Size 1.4 MB
Tags Linux musl 1.2+ x86-32 Python 3
SHA-256 checksum
How to use checksums
71f1fb3be43d3328cbaf57e311acf6e4b7a2ab1d68054b266eb6e24e8d800a95
BLAKE2b-256 checksum
How to use checksums
bd0ddd186eb61e870a80e5d2fbd86e5f80efb317cdfb84ef2ebc0e5ad6e8d024
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-musllinux_1_2_armv7l.whl

Download URL labelme2yolo-0.2.2-py3-none-musllinux_1_2_armv7l.whl
Size 1.3 MB
Tags Linux musl 1.2+ ARMv7l Python 3
SHA-256 checksum
How to use checksums
af5fe2d8646f3c707bfccd58ba8ec6cad17e06e3fc5495f32998196b70cbde50
BLAKE2b-256 checksum
How to use checksums
8c36d29cf6b1ecc7db49acd91d2307c10b77a26e284b2afcc3722d39bee4dbe0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-musllinux_1_2_aarch64.whl

Download URL labelme2yolo-0.2.2-py3-none-musllinux_1_2_aarch64.whl
Size 1.3 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
8f0ebb51f4566473027851b71ad75560bfc93dc1992f03aa2121691b31c6610b
BLAKE2b-256 checksum
How to use checksums
9e4ddee99004277900cda207ee6f1c6c819a4dd6694b37c28313562a23137eb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL labelme2yolo-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.4 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
8e6ec2fb4ab3945a4b9d004a47271f862f67fa987dfafbb6c0fa09044730782e
BLAKE2b-256 checksum
How to use checksums
4ca3298bc7a5565d89e58e709a10f599cf981ca5293b062da3799fc1c9d7feaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL labelme2yolo-0.2.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 1.5 MB
Tags Linux glibc 2.17+ IBM System/390x Python 3
SHA-256 checksum
How to use checksums
bf1a9fa88caa3b73f185317c8d903eb986127793ecf6796d4dcc6d600a74b229
BLAKE2b-256 checksum
How to use checksums
1e91f0140c4a84bad37ee1882fd4ad316d95933843541e8a6d6fdf308ddf02ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL labelme2yolo-0.2.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 1.4 MB
Tags Linux glibc 2.17+ PowerPC 64-le Python 3
SHA-256 checksum
How to use checksums
be8b9ce89b19267291a2c9e1b0bcfa42af19b9740c9f9065d21c987177176307
BLAKE2b-256 checksum
How to use checksums
d9851f5516ee3d93ac0346d4f86ccc2e37ab6214caad0ba3bfd92ef0f68f8336
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL labelme2yolo-0.2.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Size 1.4 MB
Tags Linux glibc 2.17+ x86-32 Python 3
SHA-256 checksum
How to use checksums
594ef507f63507a519df21d51bdfb5edefc7ca823e480158846dc5ac6f98958e
BLAKE2b-256 checksum
How to use checksums
efb8d13ce04f90c58808fb9f31f7cc9a7910b37d41872e860c08628bfb38caaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL labelme2yolo-0.2.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 1.3 MB
Tags Linux glibc 2.17+ ARMv7l Python 3
SHA-256 checksum
How to use checksums
507ef7fc10dc03836b3c3d5fe83506411119a2dc33ab6355ac10be2fdf8e70c1
BLAKE2b-256 checksum
How to use checksums
9568b23282883ccb514f34ceea1b3748e73cb63a6dffc6b71eb3f1d1f48eeced
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL labelme2yolo-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.3 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
da443737e04f050610540707fb6088c6b0c8fdc584e6e54e7c308d7b4654a1a0
BLAKE2b-256 checksum
How to use checksums
9f46e20a488728aadad2c637d08faabe80202727e5c223aa4a5b4a9cd9aac220
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-macosx_11_0_arm64.whl

Download URL labelme2yolo-0.2.2-py3-none-macosx_11_0_arm64.whl
Size 1.2 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
96b20c9ebd78145d47328419108eddf7860f369d9d3a43d8e8c88e4183017cee
BLAKE2b-256 checksum
How to use checksums
766b17ab2ea6d294717d1aeeb4413223f72eaf6a3da32b076e3a35c4cd515219
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / labelme2yolo-0.2.2-py3-none-macosx_10_12_x86_64.whl

Download URL labelme2yolo-0.2.2-py3-none-macosx_10_12_x86_64.whl
Size 1.2 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3be07bd9b146e52d11421644bc4e3c4057132d0d295ef6bf7075717ec37fd664
BLAKE2b-256 checksum
How to use checksums
a60e90ce1e070b94c18504629deaae117eae63cbb636c16f9f4038295e5c645f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release history Release notifications | RSS feed

0.3.2

15 release files

0.3.0

15 release files

0.2.5

15 release files

0.2.4

15 release files

0.2.3

15 release files

This release

0.2.2 This release

15 release files

0.2.1

15 release files

0.2.0

15 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.2

2 release files

0.0.1

2 release 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