ultralytics-segment-json

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

One image, one instance; normalize=False. Corners and contours use original-image pixels. Image identity and dimensions come from separate context.

Example

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

[
  {
    "box": {
      "x1": 10,
      "x2": 50,
      "y1": 20,
      "y2": 60
    },
    "class": 0,
    "confidence": 0.8,
    "name": "insect",
    "segments": {
      "x": [10, 50, 50, 10],
      "y": [20, 20, 60, 60]
    }
  }
]

Convert to a standard format

This format is documented, but a conversion adapter is not yet registered.

General conversion example and required context

How to interpret it

Scope: One image per call; top-level array of instances. No image path, dimensions or class-name lookup table in the JSON.

Coordinates: Default: original-image pixel corner coordinates. normalize=True divides x by image width and y by height, including segmentation coordinates.

Tracking: track_id is omitted for ordinary predictions; present for tracking results.

Empty: No detections produces an empty array.

Source definitions