Skip to main content

Merge .json COCO files

This package is intended for data scientist who wants to merge several COCO datasets before training a new model.

Requirements

python==3.x

Installation

Simply set up a Python environment and type :

pip install COCO_merger

COCO Files Merge Usage

python -m COCO_merger.merge --src Json1.json Json2.json --out OUTPUT_JSON.json

Argument parser

usage: merge.py [-h] --src SRC SRC --out OUT

Merge two annotation files to one file

optional arguments:
  -h, --help     show this help message and exit
  --src SRC SRC  Path of two annotation files to merge
  --out OUT      Path of the output annotation file

Note:

The script will do the following checks as well:

  1. Duplicate filenames checks (to count if the same image has two annotations)
  2. Categories checks (Both files should have same categegories (name, id))

The reason I didn't mix categories, incase they are different, is to help annotators identifying any change in there categories. I believe this will be helpful incase of annotating a dataset as batches or splitting the annotation on members. Any change in ids caused by software being used or human mistake will be directly identified.

Example of Dog category existing in file 2 but not file 1

AssertionError: Category name: Dog in file 2 does not exist in file 1

Example of Cat category existing in both files but with different ids:

AssertionError: Category name: Cat, id: 1 in file 1 and 2 in file 2


Note: the script will do the necessary checks as well (duplicate filenames, ....)

Metadata

Release files for COCO-merger 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for COCO-merger 0.0.2
File Size Uploaded Provenance
COCO_merger-0.0.2.tar.gz 5.5 kB Without provenance Details

Release files / COCO_merger-0.0.2.tar.gz

Download URL COCO_merger-0.0.2.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
176cfbac3d272d64c84d5e139a32e94ef0279f93e1c00e28adadd6e865f03583
BLAKE2b-256 checksum
How to use checksums
c8d2ea3c4b8f0d104325163b9af03025a8a3893cc3165f89c8891de95ce1539f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Security for COCO-merger 0.0.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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

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