Skip to main content

Forked from rooneysh/Labelme2YOLO

Labelme2YOLO

PyPI - Version PyPI - Downloads PyPI - Python Version Codacy Badge

Help converting LabelMe Annotation Tool JSON format to YOLO text file format. If you've already marked your segmentation dataset by LabelMe, it's easy to use this tool to help converting to YOLO format dataset.


New

  • export data as yolo polygon annotation (for YOLOv5 v7.0 segmentation)

Installation

pip install labelme2yolo

Parameters Explain

--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.2 means 20% for Test.

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

How to Use

1. Convert JSON files, split training, validation and test dataset by --val_size and --test_size

Put all LabelMe JSON files under labelme_json_dir, and run this python command.

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

Script would generate YOLO format dataset labels and images under different folders, for example,

/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

2. Convert JSON files, split training and validation dataset by folder

If you already split train dataset and validation dataset for LabelMe by yourself, please put these folder under labelme_json_dir, for example,

/path/to/labelme_json_dir/train/
/path/to/labelme_json_dir/val/

Put all LabelMe JSON files under labelme_json_dir. Script would read train and validation dataset by folder. Run this python command.

labelme2yolo --json_dir /path/to/labelme_json_dir/

Script would generate YOLO format dataset labels and images under different folders, for example,

/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

3. Convert single JSON file

Put LabelMe JSON file under labelme_json_dir. , and run this python command.

labelme2yolo --json_dir /path/to/labelme_json_dir/ --json_name 2.json

Script would generate YOLO format text label and image under labelme_json_dir, for example,

/path/to/labelme_json_dir/2.text
/path/to/labelme_json_dir/2.png

License

labelme2yolo is distributed under the terms of the MIT license.

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.0.8.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

labelme2yolo-0.0.8-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: labelme2yolo-0.0.8.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.1

File hashes

Hashes for labelme2yolo-0.0.8.tar.gz
Algorithm Hash digest
SHA256 c055d63f62c26a72fd72a11e894f2f1e40c9cfc65d1bffa0b77dab0ff5f5de19
MD5 44ef2330f61d0b6e59ec76b53f4fd473
BLAKE2b-256 26d799e87241ec2732c2473672ad59fe20f6237bcb0159a26bec8f04288e5c86

See more details on using hashes here.

File details

Details for the file labelme2yolo-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: labelme2yolo-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.1

File hashes

Hashes for labelme2yolo-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1c7e8c0ef00fa2a6e72639377c761c293eb77704426d1734f6985c2a88eb8dc5
MD5 c879b02ac1882da1f109be3f872bb552
BLAKE2b-256 ea2751dce59bc327485cae6b2d5316ff7e13b383106787e08059ab29a3f4791a

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

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

This release

0.0.8 This release

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