Skip to main content

The universal annotation converter

Project description

Panlabel

CI Crates.io Version PyPI Version GitHub License GitHub Repo stars Crates.io Total Downloads PyPI Downloads

The universal annotation converter

If you've ever written a one-off Python script to wrangle COCO annotations into YOLO format (or vice versa), panlabel is here to save you the trouble. It's a fast, single-binary CLI that converts between common object detection annotation formats — with built-in validation, clear lossiness warnings, and no Python dependencies to manage.

Panlabel is also available as a Rust library if you want to integrate format conversion into your own tools.

Note: Panlabel is in active development (v0.4.x). The CLI and library APIs may change between versions, so pin to a specific version if you're using it in production.

Installation

pip / uv (any platform)

pip install panlabel
# or
uv pip install panlabel

This installs a pre-built binary — no Rust toolchain needed.

Homebrew (macOS / Linux)

brew install strickvl/tap/panlabel

Shell script (macOS / Linux)

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/strickvl/panlabel/releases/latest/download/panlabel-installer.sh | sh

PowerShell (Windows)

powershell -ExecutionPolicy Bypass -c "irm https://github.com/strickvl/panlabel/releases/latest/download/panlabel-installer.ps1 | iex"

Cargo (from source)

cargo install panlabel
# Enable full HF support (remote Hub import + metadata.parquet)
cargo install panlabel --features hf

Pre-built binaries

Download from the latest GitHub Release. Builds are available for macOS (Intel + Apple Silicon), Linux (x86_64 + ARM64), and Windows.

Docker

docker pull strickvl/panlabel
# Convert a COCO file in your current directory to YOLO
docker run --rm -v "$PWD":/data strickvl/panlabel convert -f coco -t yolo -i /data/annotations.json -o /data/yolo_out --allow-lossy

Multi-arch images (amd64 + arm64) are published for each release.

As a Rust library

cargo add panlabel

Quick start

# Convert COCO annotations to YOLO (auto-detects the input format)
panlabel convert --from auto --to yolo -i annotations.json -o ./yolo_out --allow-lossy

# Convert a YOLO dataset to COCO JSON
panlabel convert -f yolo -t coco -i ./my_dataset -o coco_output.json

# Convert a Pascal VOC dataset to COCO JSON
panlabel convert -f voc -t coco -i ./voc_dataset -o coco_output.json

# Convert Label Studio JSON to COCO JSON
panlabel convert -f label-studio -t coco -i export.json -o coco_output.json

# Convert CVAT XML to COCO JSON
panlabel convert -f cvat -t coco -i annotations.xml -o coco_output.json

# Convert local HF ImageFolder metadata to COCO JSON
panlabel convert -f hf -t coco -i ./hf_dataset -o coco_output.json

# Convert remote HF dataset repo to COCO JSON (requires --features hf when building from source)
panlabel convert -f hf -t coco --hf-repo rishitdagli/cppe-5 --split train -o coco_output.json

# Convert a zip-style HF dataset repo split to IR JSON (auto-detects extracted payload format)
panlabel convert -f hf -t ir-json --hf-repo keremberke/football-object-detection --split train -o football.ir.json

# Check a dataset for problems before training
panlabel validate --format coco annotations.json

# Get a quick overview of what's in a dataset
panlabel stats --format coco annotations.json

# Compare two datasets
panlabel diff --format-a auto --format-b auto old.json new.json

# Sample a smaller subset for quick experiments
panlabel sample -i annotations.json -o sample.ir.json --from auto --to ir-json -n 100 --seed 42

What can panlabel do?

Command What it does
convert Convert between annotation formats, with clear warnings about what (if anything) gets lost
validate Check your dataset for common problems — duplicate IDs, missing references, invalid bounding boxes
stats Show rich dataset statistics in text, JSON, or HTML
diff Compare two datasets semantically (summary or detailed output)
sample Create subset datasets (random or stratified), with optional category filtering
list-formats Show which formats are supported and their read/write/lossiness capabilities

Supported formats

Format Extension / Layout Description Lossiness
ir-json .json Panlabel's own intermediate representation Lossless
coco .json COCO object detection format Conditional
cvat .xml / annotations.xml export CVAT for images XML annotation export Lossy
label-studio .json Label Studio task export JSON (rectanglelabels) Lossy
tfod .csv TensorFlow Object Detection Lossy
yolo images/ + labels/ directory Ultralytics YOLO .txt labels Lossy
voc Annotations/ + JPEGImages/ directory Pascal VOC XML Lossy
hf metadata.jsonl / metadata.parquet directory Hugging Face ImageFolder metadata Lossy

Run panlabel list-formats for the full details.

list-formats shows canonical names (for example label-studio), while commands also accept aliases (for example ls, label-studio-json).

More convert examples

# COCO to IR JSON (lossless — no data lost)
panlabel convert -f coco -t ir-json -i input.json -o output.json

# IR JSON to TFOD (lossy — requires explicit opt-in)
panlabel convert -f ir-json -t tfod -i input.json -o output.csv --allow-lossy

# Auto-detect input format from file extension/content or directory layout
panlabel convert --from auto -t coco -i input.csv -o output.json

Getting help

panlabel --help              # See all commands
panlabel convert --help      # Help for a specific command
panlabel -V                  # Show version

Documentation

Want to go deeper? The full docs are readable right here on GitHub:

Contributing

Contributions are welcome! Whether it's a bug report, a new format adapter, or a documentation fix — we appreciate the help. For major changes, please open an issue first so we can discuss the approach.

See the contributing guide for details on the codebase structure and how to make changes.

License

MIT — see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panlabel-0.5.0.tar.gz (264.0 kB view details)

Uploaded Source

Built Distributions

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

panlabel-0.5.0-py3-none-win_amd64.whl (1.2 MB view details)

Uploaded Python 3Windows x86-64

panlabel-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

panlabel-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

panlabel-0.5.0-py3-none-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

panlabel-0.5.0-py3-none-macosx_10_12_x86_64.whl (1.3 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file panlabel-0.5.0.tar.gz.

File metadata

  • Download URL: panlabel-0.5.0.tar.gz
  • Upload date:
  • Size: 264.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for panlabel-0.5.0.tar.gz
Algorithm Hash digest
SHA256 7bb2be470a83b97e5c3cda7eb0a10bffc7e09e39c1d463789c1d870cead69c09
MD5 5be62868fc11985a79a6c29fac43edbe
BLAKE2b-256 4b851bd39f72feefb0830e3e1f6a25b69219808b536ef6e71bb384951c9c5b4f

See more details on using hashes here.

File details

Details for the file panlabel-0.5.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: panlabel-0.5.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for panlabel-0.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 58149a083acba1f8e26a6744ca180ad2e00494321c4a9624676bf88316bea78e
MD5 d49806c63d105c3a80a94124aa7f3c15
BLAKE2b-256 1db30c30d3dd1adffb42424316d0bcd093fb5f060faaf6d10af7805d6efc228f

See more details on using hashes here.

File details

Details for the file panlabel-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: panlabel-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for panlabel-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a95475651ef00800cc82c4cdb8ae520c7ed358fad465c49fc696d8f1f3be7370
MD5 aec7a1ae3cba1a8c107640a43266e76e
BLAKE2b-256 c37ceed53d809f5eeb199ce375056b83f15916713f83381d173d32e04585a10c

See more details on using hashes here.

File details

Details for the file panlabel-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

  • Download URL: panlabel-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for panlabel-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 eb1dc01728b9b08d0bea2af3eaf23eb007e1a6879b71627597613548e0cdfef2
MD5 4939066b667c60fe9e3141fdce7e0563
BLAKE2b-256 cfad48d0f4372aff1d6d671acdd5da0169ed4414ff272d1684f282a2bc440eae

See more details on using hashes here.

File details

Details for the file panlabel-0.5.0-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: panlabel-0.5.0-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for panlabel-0.5.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc142153e9b1fcdcb8815c3dd0cc0f951b871d5cde353551197e0d20152f3cc4
MD5 a627b9c85e800ca9b0745597ed1f3f64
BLAKE2b-256 69b2a05644cd02f39f66836ba168dfccb51c71055d4bc241ff7aaf063c60bcdd

See more details on using hashes here.

File details

Details for the file panlabel-0.5.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: panlabel-0.5.0-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for panlabel-0.5.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4d129d36a4a411b361719c79a837fae54d084b8e79410a9ee8fa85a272c9ba4e
MD5 957fd2fd596141007345a370d1a11f97
BLAKE2b-256 1f85e97a0faf3ec31fdc0f7fa881858fab34b1914dc1feeaf6d5c780abbb783d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page