Vector JSON

To import annotations to a Vector Project, you need to import a JSON file of the annotations.

The explanation will be based on the following example:

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

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

🚧

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

Metadata

{
    "width": 1920,
    "height": 1080,
    "name": "94573794"
}

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

[
    "Shapes",
    "Vector"
  ]

Description:

  • “Shapes”: string - The tag name.

Instances

Polyline and polygon

{
      "type": "polygon",
      "className":"pentagon",
      "probability": 100,
      "points": [
                322.18,
                249.03,
                585.14,
                261.22,
                377.9,
                449.31,
                243.81,
                410.99
       ],
      "groupId": 0,
      "pointLabels": {},
      "attributes": [
        {
          "name":"Green",
          "groupName":"Color"
        }
      ],
      "trackingId": null,
      "error": null,
      "locked": false
}

Description:

  • “type” : string - Instance type.
  • "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.
  • “points”: array of objects - Points of the polygon. The list of floats is: [x0, y0, x1, y1, ….. xN, yN].
  • “groupId”: integer - Group ID of instances
  • “pointLabels”: string - The keys are from “0” to “N-1” where a polygon has N vertices.
  • “attributes”: array of objects - List of attributes for this polygon.
    • "name": string - Attribute name
    • "groupName": string - Group name
  • “trackingId”: integer - The ID of a duplicated instance.
  • “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.
  • “locked”: boolean - If it’s true, you won't be able to move the instance. If it’s false, you'll be able to move the instance.

Bounding box and rotated bounding box

{
      "type": "bbox",
      "className": "Square",
      "probability": 100,
      "points": {
        "x1": 104.73,
        "x2": 549.82,
        "y1": 137.45,
        "y2": 377.45
      },
      "groupId": 0,
      "pointLabels": {},
      "attributes": [
        {
          "name":"Purple",
          "groupName":"Color"
        }
      ],
      "trackingId": null,
      "error": null,
      "locked": false
    }

Description:

  • “type”: string - Instance type.
  • "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.
  • “points”: objects - Points of the bounding box. The list of floats is: "x1, y1" for the left upper corner, and "x2, y2" for the right lower corner.
  • “groupId”: integer - Group ID of instances
  • “pointLabels”: objects - The keys are from “0” to “7” for the 8 vertices of the bounding box.
  • “attributes”: array of objects - List of attributes for this bounding box.
    • "name": string - Attribute name
    • "groupName": string - Group name
  • “trackingId”: integer - The ID of a duplicated instance.
  • “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.
  • “locked”: boolean - If it’s true, you won't be able to move the instance. If it’s false, you'll be able to move the instance.

Template

{
      "type": "template",
      "className": "Cuboid",
      "probability": 100,
      "points": [
        {
          "id": 1,
          "x": 712.5123693292791,
          "y": 141.81817626953125
        },
        {
          "id": 2,
          "x": 709.0908813476562,
          "y": 456
        },
        {
          "id": 3,
          "x": 1153.8843189586291,
          "y": 452.69282290810036
        },
        {
          "id": 4,
          "x": 1095.7190232710404,
          "y": 356.7846872430099
        },
        {
          "id": 5,
          "x": 1095.7190232710404,
          "y": 217.8832493832237
        },
        {
          "id": 6,
          "x": 1160.727294921875,
          "y": 145.1253533614309
        }
      ],
      "connections": [
        {
          "id": 1,
          "from": 1,
          "to": 6
        },
        {
          "id": 2,
          "from": 1,
          "to": 2
        },
        {
          "id": 3,
          "from": 2,
          "to": 3
        },
        {
          "id": 4,
          "from": 6,
          "to": 3
        },
        {
          "id": 5,
          "from": 3,
          "to": 4
        },
        {
          "id": 6,
          "from": 4,
          "to": 5
        },
        {
          "id": 7,
          "from": 5,
          "to": 6
        }
      ],
      "groupId": 0,
      "pointLabels": {},
      "attributes": [
        {
          "name":"Blue"
          "groupName":"Color"
        }
      ],
      "templateId": 1641,
      "trackingId": null,
      "error": null,
      "locked": false
}

Description:

  • “type”: string - Instance type.
  • "className": string - Class name (one of the class names in “classes.json”)
  • "templateName": string - Template name (one of the template names defined on the platform)
  • “probability”: integer - Instance prediction score. If the instance was created manually, then the probability value is 100.
  • “points”: array of objects - List of 6 dictionaries {“id”: int, “x”: float, “y”: float}.
  • “connections”: array of objects - List of 7 connections {“id”: int, “from”: int, “to”: int}.
  • “groupId”: integer - Group ID of instances
  • “pointLabels”: objects - The keys are numbers that range from 0 to 21, and the values are human body points. The default point is the nose: {“0”: “Nose”}.
  • “attributes”: array of objects - List of attributes for this template.
    • "name": string - Attribute name
    • "groupName": string - Group name
  • “templateId”: integer - The ID of the human pose template is 402.
  • “trackingId”: integer - The ID of a duplicated instance.
  • “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.
  • “className”: string - Class name (one of the class names in “classes.json”)
  • “locked”: boolean - If it’s true, you won't be able to move the instance. If it’s false, you'll be able to move the instance.

Point

{
      "type": "point",
      "className": "Point",
      "probability": 100,
      "x": 1769.45,
      "y": 425.45,
      "groupId": 0,
      "pointLabels": {},
      "attributes": [
        {
          "name": "Blue",
          "groupName": "Color"
        }
      ],
      "trackingId": null,
      "error": null,
      "locked": false
}

Description:

  • “type”: string - Instance type.
  • "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.
  • “x”: number - x-coordinate
  • “y”: number - y-coordinate
  • “groupId”: integer - Group ID of instances
  • “pointLabels”: objects - The key is "0".
  • “attributes”: array of objects - List of attributes for this polygon.
    • "name": string - Attribute name
    • "groupName": string - Group name
  • “trackingId”: integer - The ID of a duplicated instance.
  • “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.
  • “locked”: boolean - If it’s true, you won't be able to move the instance. If it’s false, you'll be able to move the instance.

Ellipse

{
      "type": "ellipse",
      "className": "Ellipse",
      "probability": 100,
      "cx": 377.46,
      "cy": 806.18,
      "rx": 316.36,
      "ry": 134.18,
      "angle": 0,
      "groupId": 0,
      "pointLabels": {},
      "attributes": [
        {
          "name": "Red",
          "groupName": "Color"
        }
      ],
      "trackingId": null,
      "error": null,
      "locked": false
    }

Description:

  • “type”: string - Instance type.
  • "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.
  • “cx”: number - x-coordinate of the center
  • “cy”: number - y-coordinate of the center
  • “rx”: number - x radius
  • “ry”: number - y radius
  • "angle”: integer - rotation angle
  • “groupId”: integer - Group ID of instances
  • “pointLabels”: objects - The keys are numbers that range from "0" to "8", and the values are texts.
  • “attributes”: array of objects - List of attributes for this polygon.
    • "name": string - Attribute name
    • "groupName": string - Group name
  • “trackingId”: integer - The ID of a duplicated instance.
  • “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.
  • “locked”: boolean - If it’s true, you won't be able to move the instance. If it’s false, you'll be able to move the instance.

Cuboid

{
      "type": "cuboid",
      "className":"Cuboid",
      "probability": 100,
      "points": {
        "f1": {
          "x": 835.63,
          "y": 545.46
        },
        "f2": {
          "x": 1232.72,
          "y": 846.55
        },
        "r1": {
          "x": 1082.18,
          "y": 735.27
        },
        "r2": {
          "x": 1474.91,
          "y": 1042.91
        }
      },
      "groupId": 0,
      "pointLabels": {},
      "attributes": [
        {
          "name":"Green",
          "groupName":"Color"
        }
      ],
      "trackingId": null,
      "error": null,
      "locked": false
}

Description:

  • “type”: string - Instance type.
  • "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.
  • “points”: objects - “f1” and “f2” are front box points with “x” and “y” coordinates, and “r1” and “r2” are rear box points with “x” and “y” coordinates.
  • “groupId”: integer - Group ID of instances
  • “pointLabels”: objects - The keys are numbers that range from "0" to "8", and the values are texts.
  • “attributes”: array of objects - List of attributes for this cuboid.
    • "name": string - Attribute name
    • "groupName": string - Group name
  • “trackingId”: integer - The ID of a duplicated instance.
  • “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.
  • “locked”: boolean - If it’s true, you won't be able to move the instance. If it’s false, you'll be able to move the instance.

Did this page help you?