Vector Project - Import annotation format

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

Tag

{
      "name": "Dog",
      "color": "#4e7b3a",
      "type": "tag",
      "attribute_groups": [
        {
          "name": "Position",
          "is_multiselect": 0,
          "attributes": [
            {
              "name": "Labrador"
            }
          ]
        }
      ]
    }
  • "name": string - Class Name
  • "color": string - Class’s hex color code (e.g. #000000)
  • "type": string - Class type. It could either be object or tag.
  • "attribute_groups": array of objects - List of all the attributes
    • "name": string - Attribute Name

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"
        }
      ],
      "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
  • “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"
        }
      ],
      "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
  • “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.

Point

{
      "type": "point",
      "className": "Point",
      "probability": 100,
      "x": 1769.45,
      "y": 425.45,
      "groupId": 0,
      "pointLabels": {},
      "attributes": [
        {
          "name": "Blue",
          "groupName": "Color"
        }
      ],
      "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
  • “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"
        }
      ],
      "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
  • “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"
        }
      ],
      "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
  • “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?