Skip to main content

Tools to merge and remap computer vision datasets

Project description

datakit

Python package for YOLO-format dataset operations:

  • merge multiple datasets into one
  • merge multiple class names into a target class
  • remap class IDs
  • visualize labeled samples

Install

pip install -e .

CLI Usage

1) Merge datasets

datakit merge /path/ds1 /path/ds2 --out /path/out

2) Merge classes

datakit merge-classes /path/dataset --from Backpack Backpacks --to bag

3) Remap classes

datakit remap /path/dataset --names bag person --map 0:0 1:0 2:1

Remap safety behavior:

  • validates that all mapped target IDs are within length of given class range
  • pre-scans all label files to ensure every class ID has a mapping before writing
  • only writes labels and data.yaml after validation succeeds

4) Visualize samples

datakit visualize --images-dir /path/dataset/val/images --labels-dir /path/dataset/val/labels --n 12 --seed 1

Python API

from datakit import merge_datasets, merge_classes, remap_dataset, plot_random_samples

merge_datasets(["/path/ds1", "/path/ds2"], "/path/out")
merge_classes("/path/dataset", ["Backpack", "Backpacks"], "bag")
remap_dataset("/path/dataset", ["bag", "person"], {0: 0, 1: 0, 2: 1})
plot_random_samples("/path/dataset/val/images", "/path/dataset/val/labels", n=12, seed=1)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

cv_datakit-0.1.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file cv_datakit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cv_datakit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for cv_datakit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef9f06c7ddc1d575d474d4cdcd5c60546a788114f10c0bd13967724b03545e3f
MD5 3a4d647ec8b0c090fea3dfcdab2ce896
BLAKE2b-256 34722bfe83e7af6a1c9de3b552bb99428c25fd54a4dbc5f3f7cb23931001179a

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