coco

All format examples · Machine-readable schema · Convert outputs to COCO

Two images: one detection and one explicitly empty image. bbox is top-left x,y,width,height. Import returns two ISIR records, using image_id to associate annotations.

Example

Illustrative values, not predictions from a model. Unless stated otherwise, the image is 200 pixels wide and 100 pixels high.

{
  "annotations": [
    {
      "area": 1600,
      "bbox": [10, 20, 40, 40],
      "category_id": 0,
      "id": 10,
      "image_id": 1,
      "iscrowd": 0,
      "score": 0.8
    }
  ],
  "categories": [
    {
      "id": 0,
      "name": "insect"
    }
  ],
  "images": [
    {
      "file_name": "frame.jpg",
      "height": 100,
      "id": 1,
      "width": 200
    },
    {
      "file_name": "empty.jpg",
      "height": 100,
      "id": 2,
      "width": 200
    }
  ]
}

Convert to a standard format

Use Converter.convert with source="coco" and target="coco". Your application supplies the predictions and any required image context or producer settings. The adapter validates whether the output contains the information the target needs.

This importer accepts multiple images: set cardinality="collection".

General conversion example and required context

Inspect the intermediate representation for this example

This developer example prints ISIR, the internal representation used between adapters. Run from the repository checkout; no model download is needed.

python3 examples/formats/to_isir.py coco

How to interpret it

Scope: COCO dataset annotation structure; prediction-only COCO result lists are a different interface.

Bbox: One [x, y, width, height] tuple per annotation, in pixels; x,y identify the top-left corner.

Metadata: Dataset info/licenses and image license/URL/date metadata may be absent. The retained Flatbug 1.2.0 COCO probe contains an empty year and date_captured=0; these placeholders are preserved, not invented timestamps.

Source definitions