Objects
Last updated
Last updated
Supervisely Annotation Format supports the following figures:
point
rectangle
polygon
line / polyline
bitmap
alpha_mask
keypoint structures
cuboid
mask_3d
For two-dimensional mediums (images and videos) we use the following coordinate system (it's similar to a two-dimensional NumPy coordinate system):
All numerical values are provided in pixels.
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
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
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
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
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.
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 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:
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 bitmap
→ data
. 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 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:
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 bitmap
→ data
. 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 structures consist of vertices (also called nodes or points) which are connected by edges (also called links or lines).
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
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 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.
💡 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_3d
→ data
will store an empty array represented as base64 encoded string.