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 cv-datakit
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
0..len(new_names)-1 - pre-scans all label files to ensure every class ID has a mapping before writing
- only writes labels and
data.yamlafter validation succeeds - note: writes are not yet atomic across process interruption (power loss/kill)
4) Visualize samples
datakit visualize --images-dir /path/dataset/val/images --labels-dir /path/dataset/val/labels --n 12 --seed 1
Format selection
datakit --format yolo merge /path/ds1 /path/ds2 --out /path/out
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)
Extend to new formats
- Implement
DatasetFormatHandlerin a new module, for exampledatakit/formats/coco.py. - Register the handler in
datakit/formats/__init__.py. - Use the same CLI commands with
--format coco.
Metadata
Release files for cv-datakit 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cv_datakit-0.1.2.tar.gz | 15.7 kB | Without provenance | Details for cv_datakit-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cv_datakit-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for cv_datakit-0.1.2-py3-none-any.whl |
Total release size: 34.1 kB
Release files / cv_datakit-0.1.2.tar.gz
| Download URL | cv_datakit-0.1.2.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d43ffd32ed0881e993b2f406fa1a78b09a6c7ecc674d9b9ffbc6f4cb245ad2d
|
|
BLAKE2b-256 checksum How to use checksums |
07b74b200bf181b269060e7908d352066c7b5ccf7f3d11604bd4197a905fc3ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / cv_datakit-0.1.2-py3-none-any.whl
| Download URL | cv_datakit-0.1.2-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b939c8f06f97458574da520852a6f7ca71e560ea35ad108eaa39b38f2a63c38
|
|
BLAKE2b-256 checksum How to use checksums |
399e69099748e460aefc263bd91243ed6eed4009e9d04732cc4e3b4ea713b21d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for cv-datakit 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.