Pixel Project - Import annotation format

To import annotations to a Pixel Project, you need to import a JSON file of the annotations and annotation masks (PNG files).

Annotations JSON format

The annotations JSON in a Pixel Project contains four main fields: metadata, comments, tags, and instances.

{
    "metadata": {},
    "comments": [],
    "tags": [],
    "instances": []
}

🚧

The fields that are marked in bold in the descriptions are mandatory.

Metadata

{
    "width": 1920,
    "height": 1280,
    "name": "en5Cuu0nbTo.jpg"
}

Description:

  • "width": integer - The image’s width.
  • "height": integer - The image’s height.
  • "name": string - The name of the image.

Comments

[
  {
    "correspondence": [
      {
          "text": "Fix this",
          "email": "[email protected]"}
      ],
      "x": 987.98,
      "y": 722.87,
      "resolved": false
}]

Description:

  • "correspondence": array of objects - List of messages in the comment.
    • "text": string - The comment.
    • "email": string - The email address of the user who wrote the comment.
  • “x”: number - X position of the comment on the image.
  • “y”: number - Y position of the comment on the image.
  • “resolved”: boolean - If it’s true, then the comment is resolved. If it’s false, then the comment isn't resolved.

Tags

[
    "Road",
    "Car"
  ]

Description:

  • “Road”: string - The tag name.

Instances

{
      "className": "Car",
      "probability": 100,
      "attributes": [
        {
          "name":"Taxi",
          "groupName":"Type"
        }
      ],
      "parts": [
        {
          "color": "#00013b"
        }
      ],
      "error": null
}

Description:

  • “className”: string - Class name (one of the class names in “classes.json”)
  • “probability”: integer - Instance prediction score. If the instance was created manually, then the probability value is 100.
  • “attributes”: array of objects - List of attributes for this instance.
    • "name": string - Attribute name
    • "groupName": string - Group name
  • "parts": array of objects - The colors of the instance's segment in the mask PNG file.
    • "color": string - The instance's HEX color code.
  • “error”: boolean - If the instance is approved, then it’s false. If it’s disapproved, then it’s true. If you approve or disapprove an instance then undo the action, then it’s null. If the instance is neither approved nor disapproved, then error won’t appear in JSON.

Annotation masks

An annotation mask is a PNG file that contains one instance or multiple instances. The instances will be colored while the areas that aren't annotated will have all four channels (R,G,B,A) set to zero.

Instances in the **Pixel Editor** / Instances in the annotation maskInstances in the **Pixel Editor** / Instances in the annotation mask

Instances in the Pixel Editor / Instances in the annotation mask


Did this page help you?