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

Metadata

Release files for labelme2yolo 0.2.5

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.5
File Size Uploaded
labelme2yolo-0.2.5.tar.gz 14.2 kB Details

Built distributions (wheels)

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

Total release size: 18.5 MB

Release files / labelme2yolo-0.2.5.tar.gz

Download URL labelme2yolo-0.2.5.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
56c94228b923cf14917cd2dc001d12056449328f52473434eca424cc5e545840
BLAKE2b-256 checksum
How to use checksums
09de1c59cd620965a396acde196771551fb349ec491c4d8de3c6b799f52ccdcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-py3-none-win_amd64.whl
Size 1.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
fc4a21c0c2496a8092fcb64e855255b75aef68762bde8448d82771d4d6a7a2c3
BLAKE2b-256 checksum
How to use checksums
31bb1c5c51a27a6ab07ff4c5a500e68127a74e5a4d269c977669a0edac5f5555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-py3-none-win32.whl
Size 969.9 kB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
095518e5f194e04ed1a15bf78890be027698eebb467668761fa7f8f9cb69cad1
BLAKE2b-256 checksum
How to use checksums
882cacd5001f4303f3d8afc981cc526adfd9536adfa61a4e5607a457a11a390d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-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
67529cad16cea202b0d8475b0c25b94d9086ff9e384672ce9eebbf9e93933385
BLAKE2b-256 checksum
How to use checksums
86820f64a0a0df48af16da5f912f3a6eec3f60bd0357209ac02f745c418748d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-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
6193b07f2092a9cb1e712b3856536afe6607b7e24a1dd9523af7f5a28a638c56
BLAKE2b-256 checksum
How to use checksums
1fd89eab57006ca16a110fc14733d02c10ba5254233d3b890e22eefbd248a4cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-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
0b1061acb1405c2d4d6ada11608e8c636bdc3ba148e91fbf4d69c5ef565f1b36
BLAKE2b-256 checksum
How to use checksums
a5204fd2773ebe4d0312b05218dcc25169a089ec742d0be1d23e75b365cc7596
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-py3-none-musllinux_1_2_aarch64.whl
Size 1.4 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
b7397d01942561a0070b8df30c4e3a71882e45d47565d8537d544543536b938f
BLAKE2b-256 checksum
How to use checksums
01984cf2b1ebf60f33335f797e1e0ad65b2c194c31741d2cb72fb269a31607c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-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
321c2df606b75eb9cb7b1df76412a85bc1ffac413aefc518782b49d8d1efa99c
BLAKE2b-256 checksum
How to use checksums
49007c5a9543bb4b5b1db10648645ed9155936e9bd035a4662b6626cdfc512bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-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
188b608ee15561ac59a6b22ac388974ad64c4477c0bccffb66a380c03da647ad
BLAKE2b-256 checksum
How to use checksums
a5acc57244d7ab7b32f90bb32bc495cdc578feb27d0fee750e4848b11ddd4d5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-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
d6914e55d031ccb85eeaf1043c5f99a57a732398cd7ab748cab6bd8056bb406e
BLAKE2b-256 checksum
How to use checksums
1bc6734ff77fb58a0522208a5cd28581813d3d67dd7fe0f455119acb09d6cc03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-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
1dfce46f889385486c10f2d1c4f49fa26d334ed60fbd06939daf68dfea5978eb
BLAKE2b-256 checksum
How to use checksums
4d5395e9b8b12c4a06f61d769d5509db2efe7f4da504b3b2265b48a254768002
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-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
b2289c5badf13716fe6cb463c57130a8ca78338d6cebef905f1b2e71e4d8d7ae
BLAKE2b-256 checksum
How to use checksums
944a34394d6e9f192db0cdfc8390f7106d598465f820cf058e202f57ef7676d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-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
b3d9037fd05955df06a64095878cbc999d81f767a37739a7a2f8ec1d38cec9db
BLAKE2b-256 checksum
How to use checksums
0701afd48571a2b0e7371ef90d46c2416f92f9c09aa2384f2cc08835bfef0da8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

Download URL labelme2yolo-0.2.5-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
994b58e973dca4ed136764066404864ea8847b912fb29f6965e4e84f5d7baec7
BLAKE2b-256 checksum
How to use checksums
1cda206ec5b78b60c8675bae323a9ea9bba879a2fd1a973a7f937e544fb93454
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.1

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

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

Release history Release notifications | RSS feed

0.3.2

15 release files

0.3.0

15 release files

This release

0.2.5 This release

15 release files

0.2.4

15 release files

0.2.3

15 release files

0.2.2

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