Objects

Supported Shapes

Supervisely Annotation Format supports the following figures:

  • point

  • rectangle

  • oriented_bbox

  • polygon

  • line / polyline

  • bitmap

  • alpha_mask

  • keypoint structures

  • cuboid

  • mask_3d

Coordinate System

For two-dimensional mediums (images and videos) we use the following coordinate system (it's similar to a two-dimensional NumPy coordinate system):

coordinate system

All numerical values are provided in pixels.

General Fields

When generating JSON annotation files, we assign each figure a mix of general fields and fields unique for each geometric shape. Some general fields are optional: the system generates them automatically when the data is uploaded/first created. This means that these fields can be omitted during manual annotation.

Optional fields:

Fields definitions:

  • id - unique identifier of the current object

  • classId - unique class identifier of the current object

  • labelerLogin - string - the name of user who created the current figure

  • createdAt - string - date and time of figure creation

  • updatedAt - string - date and time of the last figure update

  • nnCreated - boolean - indicates if the object was created by a neural network

  • nnUpdated - boolean - indicates if the object was updated or corrected by a neural network or manually by the user

Point

Example:

point example

JSON format for this shape:

Fields definitions:

  • Optional fields id, classId, labelerLogin, createdAt, updatedAt are described above

  • description - string - text description (optional)

  • geometryType: "point" - class shape

  • tags - list of tags assigned to the current object

  • classTitle - string - the title of the current class. It's used to identify the corresponding class shape from the meta.json file

  • points - object with two fields:

    • exterior - list of 2 values for coordinates (x and y in that order) for every figure

    • interior - always an empty field for this type of figure

Rectangle

Example:

rectangle example

JSON format for this figure:

Fields definitions:

  • Optional fields id, classId, labelerLogin, createdAt, updatedAt are described above

  • description - string - text description (optional)

  • geometryType: "rectangle" - class shape

  • tags - list of tags assigned to the current object

  • classTitle - string - the title of the current class. It's used to identify the corresponding class shape from the meta.json file

  • points - object with two fields:

  • exterior - list of two lists, each containing two coordinates (x and y in that order), with the following structure: [[left, top], [right, bottom]]

  • interior - always an empty list for this type of figure

Oriented Bounding Box

Oriented Bounding Box (OBB) is a rotated rectangle defined by two corner points and a rotation angle. Unlike axis-aligned Rectangle, OBBs can be rotated to better fit objects at arbitrary angles, making them ideal for annotating elongated or tilted objects like vehicles, ships, or text.

oriented bbox example

Example:

oriented bbox example

JSON format for this figure:

Fields definitions:

  • Optional fields id, classId, labelerLogin, createdAt, updatedAt are described above

  • description - string - text description (optional)

  • geometryType: "oriented_bbox" - class shape

  • tags - list of tags assigned to the current object

  • classTitle - string - the title of the current class. It's used to identify the corresponding class shape from the meta.json file

  • points - list of two lists, each containing two coordinates (x and y in that order), with the following structure: [[left, top], [right, bottom]]. These points define the axis-aligned bounding box that contains the oriented bounding box before rotation.

  • angle - rotation angle in radians. The angle is measured clockwise. For example, an angle of 0 means the box is axis-aligned, while an angle of π/4 (45 degrees) indicates a box rotated 45 degrees clockwise.

The top, left, bottom, right coordinates stored in points represent the bounding box before rotation (i.e., at angle = 0). To get the actual corner coordinates of the rotated bounding box, use the calculate_rotated_corners() method in Python SDK.

Polygon (without holes)

Example:

polygon example

Fields definitions:

  • Optional fields id, classId, labelerLogin, createdAt, updatedAt are described above

  • description - string - text description (optional)

  • geometryType: "polygon" - class shape

  • tags - list of tags assigned to the current object

  • classTitle - string - the title of the current class. It's used to identify the corresponding class shape from the meta.json file

  • points - object with two fields:

  • exterior - list of points [point1, point2, point3, etc ...] where each point is a list of two numbers (coordinates) [col, row]

  • interior - list of elements with the same structure as the "exterior" field. In other words, this is the list of polygons that define object holes. For polygons without holes in them, this field is empty

Polygon (without holes)

Example:

polygon example

Fields definitions:

  • Optional fields id, classId, labelerLogin, createdAt, updatedAt are described above

  • description - string - text description (optional)

  • geometryType: "polygon" - class shape

  • tags - list of tags assigned to the current object

  • classTitle - string - the title of the current class. It's used to identify the corresponding class shape from the meta.json file

  • points - object with two fields:

  • exterior - list of points [point1, point2, point3, etc ...] where each point is a list of two numbers (coordinates) [col, row]

  • interior - list of elements with the same structure as the "exterior" field. In other words, this is the list of polygons that define object holes.

Polyline

Example:

polyline example

Fields definitions:

  • Optional fields id, classId, labelerLogin, createdAt, updatedAt are described above

  • description - string - text description (optional)

  • geometryType: "line" - class shape

  • tags - list of tags assigned to the current object

  • classTitle - string - the title of the current class. It's used to identify the corresponding class shape from the meta.json file

  • points - object with two fields:

  • exterior - list of points [point1, point2, point3, etc ...] where each point is a list of two numbers (coordinates) [col, row]

  • interior - always an empty list for this type of figure

Bitmap

Bitmap is a figure that is described by a point of "origin"(upper left corner), which defines the location of the bitmap within the image and a "data" - Boolean matrix encoded into a string, which defines each pixel of the bitmap.

Example:

bitmap example

Fields description:

  • Optional fields id, classId, labelerLogin, createdAt, updatedAt are described above

  • description - string - text description (optional)

  • geometryType: "bitmap" - class shape

  • tags - list of tags assigned to the current object

  • classTitle - string - the title of the current class. It's used to identify the corresponding class shape from the meta.json file

  • bitmap - object with two fields:

    • origin - points (x and y coordinates) of the top left corner of the bitmap, i.e. the position of the bitmap within the image

    • data - string - encoded representation of a string

A few words about bitmapdata. You can use these two python methods to convert a base64 encoded string to NumPy and vice versa.

Example:

Program output after executing the code:

Alpha Mask

Alpha Mask is a figure that is described by a point of "origin"(upper left corner), which defines the location of the alpha mask within the image and a "data" - grayscale matrix encoded into a string, which defines each pixel of the alpha mask.

Example:

alpha mask example

Fields description:

  • Optional fields id, classId, labelerLogin, createdAt, updatedAt are described above

  • description - string - text description (optional)

  • geometryType: "alpha_mask" - class shape

  • tags - list of tags assigned to the current object

  • classTitle - string - the title of the current class. It's used to identify the corresponding class shape from the meta.json file

  • bitmap - object with two fields:

    • origin - points (x and y coordinates) of the top left corner of the alpha mask, i.e. the position of the alpha mask within the image

    • data - string - encoded representation of a string

A few words about bitmapdata. You can use these two Python methods to convert a base64 encoded string to NumPy and vice versa.

Example:

Program output after executing the code:

Keypoint structure

Keypoint structures consist of vertices (also called nodes or points) which are connected by edges (also called links or lines).

Example:

key_point_structurebitmap example

Fields definitions:

  • Optional fields id, classId, labelerLogin, createdAt, updatedAt are described above

  • description - string - text description (optional)

  • geometryType: "graph" - class shape

  • tags - list of tags assigned to the current object

  • classTitle - string - the title of the current class. It's used to identify the corresponding class shape from the meta.json file

  • nodes - is a dictionary, where keys denote the names of the graph vertices and values in a dictionary, and where values denote location of a node on image

    • loc - list of single points (x and y coordinates) of a vertices

Cuboids (2D annotation)

Example:

cuboid 2d example

Fields definitions:

  • Optional fields id, classId, labelerLogin, createdAt, updatedAt are described above

  • description - string - text description (optional)

  • geometryType: "cuboid_2d" - class shape

  • tags - list of tags assigned to the current object

  • classTitle - string - the title of the current class. It's used to identify the corresponding class shape from the meta.json file

  • vertices - is a dictionary, where keys denote the names of the cuboid vertices, and values in a dictionary with a location of a vertex on the image:

    • loc - list of single points (x and y coordinates) of a vertex

Mask3D (3D annotation)

Mask3D is a figure that is described by a 3D array corresponding to the dimensionality of the volume. It is used as an annotation type for volume projects. Geometry data stores in NRRD files and defines each pixel of the Mask3D. In the previous version whole data could be stored in JSON annotations as a base64 encoded string.

mask3d example

💡 It's strictly recommended to store whole data into NRRD files.

👉 To learn how to create Mask3D from NRRD files using our SDK you can read this article.

Below is an example of what the object looks like in the annotation file:

Fields definitions:

  • key -

  • objectKey -

  • geometryType: "mask_3d" - class shape

  • geometry - describes geometry of the object, consist of:

    • mask_3d - object with one field:

      • data- string - encoded representation of a string.

    • shape: "mask_3d" - geometry name

    • geometryType": "mask_3d" geometry type

If the geometry data is stored in NRRD files, mask_3ddata will store an empty array represented as base64 encoded string.

Last updated