Labelme2YOLO
Labelme2YOLO is a powerful tool for converting LabelMe's JSON format to YOLOv5 dataset format. This tool can also be used for YOLOv5/YOLOv8 segmentation datasets, if you have already made your segmentation dataset with LabelMe, it is easy to use this tool to help convert to YOLO format dataset.
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
polygonand bounding boxbbox.
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| labelme2yolo-0.2.1.tar.gz | 11.9 kB | Details |
Built distributions (wheels)
Total release size: 14.1 MB
Release files / labelme2yolo-0.2.1.tar.gz
| Download URL | labelme2yolo-0.2.1.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3b567a94d410439aaf9f6cf71b8aa213aa760cfbedef3510de8f2c99bc2930c
|
|
BLAKE2b-256 checksum How to use checksums |
0594f34bcf75aa41cbae89fb3dfa76cf8d97be753f6d0ffbb6ab42c9d1690d84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-win_amd64.whl
| Download URL | labelme2yolo-0.2.1-py3-none-win_amd64.whl |
|---|---|
| Size | 775.4 kB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4b7e55a49959a9aaf3f5910f84f8137942eaa01d7ef61d2e98485405ff574ed5
|
|
BLAKE2b-256 checksum How to use checksums |
03781f64f0685010d77466729c93d64adee33210e80e86daf89968802c7979df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-win32.whl
| Download URL | labelme2yolo-0.2.1-py3-none-win32.whl |
|---|---|
| Size | 729.6 kB |
| Tags | Python 3 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
65231d9cf1779dc423d9b0ed0349a65cc525795bf759fafdbb28ed2168728b56
|
|
BLAKE2b-256 checksum How to use checksums |
dff61f8897fa391554df79957d5fae32cfdf1c557b87bf879f61f92f4d5b99df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-musllinux_1_2_x86_64.whl
| Download URL | labelme2yolo-0.2.1-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
d4494672ded2ba88e84b412333c48a2b2f03a0e6ea30a14fd0ea1f4daa1eabf1
|
|
BLAKE2b-256 checksum How to use checksums |
e2fd757c5c38a8c03f6f62b300f81f1344caca93cd2d13433f0a285565282d91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-musllinux_1_2_i686.whl
| Download URL | labelme2yolo-0.2.1-py3-none-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Linux musl 1.2+ x86-32 Python 3 |
|
SHA-256 checksum How to use checksums |
f428d5127d3784ff053ec6200381549fef6d66ec92ac4943580311db350035fb
|
|
BLAKE2b-256 checksum How to use checksums |
187977feca1d7a784c7c3ecebdfa0fe6ebd399d25d3e0a6f2c3592a1775e9742
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-musllinux_1_2_armv7l.whl
| Download URL | labelme2yolo-0.2.1-py3-none-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 1.0 MB |
| Tags | Linux musl 1.2+ ARMv7l Python 3 |
|
SHA-256 checksum How to use checksums |
4c6a727c58613a1366b8c073d338e91811b0636d6052a026ac053646434e4612
|
|
BLAKE2b-256 checksum How to use checksums |
68c910c42aa8cc2e356b096264bfa288e45b1e791bf4d8f562f1749c98d8e815
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-musllinux_1_2_aarch64.whl
| Download URL | labelme2yolo-0.2.1-py3-none-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Linux musl 1.2+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
dde2e880067d5bda76f8caff05d5cba4e187c4410e9ab905857603b4e0544f15
|
|
BLAKE2b-256 checksum How to use checksums |
3d3a4f54bd38f67df00faf822f2fa70d5aabbf490ea25a7a24196aff82010038
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | labelme2yolo-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
1bc73f194b373e283cefb00759083903b343eb62f23fa82742dc4bc1370e2125
|
|
BLAKE2b-256 checksum How to use checksums |
2addb299f4e8557875dca240703ede4544535ab8794833f679d0c00de381903f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
| Download URL | labelme2yolo-0.2.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl |
|---|---|
| Size | 1.2 MB |
| Tags | Linux glibc 2.17+ IBM System/390x Python 3 |
|
SHA-256 checksum How to use checksums |
7bee0a1e9391988769ec80b18e321fe3ff17623cc381cc503aa66ea05e8d45ce
|
|
BLAKE2b-256 checksum How to use checksums |
298926246f722fa34272487a8af74e28d0ac7e25e2f2931c88450e0a2e7dd638
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
| Download URL | labelme2yolo-0.2.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Linux glibc 2.17+ PowerPC 64-le Python 3 |
|
SHA-256 checksum How to use checksums |
fb711adebe8b485349f4295361fc948470039dea0afbf273e9a6e363f3014125
|
|
BLAKE2b-256 checksum How to use checksums |
899ea9798aa045c7138cae2df5362662c4b4fb2ce4349a6c2588696f62865fc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | labelme2yolo-0.2.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Linux glibc 2.17+ x86-32 Python 3 |
|
SHA-256 checksum How to use checksums |
32a06878589e9a6e57516aba12de69b708dbeacaedb4120bdac9c739fc798e05
|
|
BLAKE2b-256 checksum How to use checksums |
4a7087d1f7607cee2dcaad3b0a93e06049128e22cbd3dc3f428ab9f5fd69a44f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
| Download URL | labelme2yolo-0.2.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl |
|---|---|
| Size | 995.2 kB |
| Tags | Linux glibc 2.17+ ARMv7l Python 3 |
|
SHA-256 checksum How to use checksums |
2fa239685eb4cc215e43b0714a2443502cb1ec78e8eeda05e99f6ac3444da6c0
|
|
BLAKE2b-256 checksum How to use checksums |
d493497690e53e699ecb33743b872826ad3fb1b73b1186f2105c724545fbc3f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | labelme2yolo-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
69a478b7e6484130aedb7e1d1b4042bb4e718712fb592860a195e77f79851f70
|
|
BLAKE2b-256 checksum How to use checksums |
b8c187c2728262d59ce264077e83e608dbc85bc59bfad00502877451b346d399
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-macosx_11_0_arm64.whl
| Download URL | labelme2yolo-0.2.1-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 919.0 kB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
48541733d2d924df6fdb942115ff94fa1a8d8f366caaea7fabad97b779ecf834
|
|
BLAKE2b-256 checksum How to use checksums |
d3c277c55283cee084983f5232705718d975f4c1acd4b853dc83f0c33f5e9aff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / labelme2yolo-0.2.1-py3-none-macosx_10_12_x86_64.whl
| Download URL | labelme2yolo-0.2.1-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 940.1 kB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
4d9410c900ac20e86fca3a76d399f30a7d4bf9a261cb2e0f4646d9175fc77029
|
|
BLAKE2b-256 checksum How to use checksums |
2a26628ba4982487919f6a7d654e5ccc39fae5bb093f557997c8e6d6ac6c8894
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|