Annotation
Annotation
An image is composed of array of pixels, and we have two ways to annotate on the pixels, by using the segmentation
tool (as RLE - run-length encoding) and vector
tool.
Segmentation (RLE)
RLE (run-length encoding) object is used only when the label type is segmentation
, and each label contains only one RLE object. When annotating with RLE, we basically annotate the pixel in the image:

An RLE object is represented as:
{
"type": STRING,
"segmentation": [
[x, y, length from x to right],
...
]
}
type: Type of the segmentation, which currently supports
rle
only.segmentation: Two-dimensional array for RLE.
The minimal unit of segmentation is a 1x1 pixel area, which is an integer.
For example, given by the 4x4 pixel image below with annotation, the array will be:
{
"segmentation": [
[2, 0, 2],
[0, 1, 3],
[2, 2, 1]
]
}

vector
A vector object is used only when the label type is vector
, and each label can contain multiple vector objects. When annotating with vector, we basically describe the coordinates of the annotation in the image:

A vector object is represented as:
{
"type": STRING,
"attributes": [
{
"name": STRING,
"values": [STRING]
}
],
"segmentation": [x1, y1, x2, y2, ..., xn, yn]
}
type: Type of the vector object, currently supports
polygon
,boundingBox
,path
andpoint
.attributes: Custom attributes to describe the vector object.
name: Name of the attribute.
values: Array of value to the attribute.
segmentation: Array of coordinate which represents the vector object.
The minimal unit of segmentation is a coordinate, which is float.
if the segmentation type is
polygon
, the value will be[x1, y1, x2, y2, ..., xn, yn]
.if the segmentation type is
boundingBox
, the value will be[x1, y1, x2, y2, x3, y3, x4, y4]
.if the segmentation type is
path
, the value will be[x1, y1, x2, y2, ..., xn, yn]
.if the segmentation type is
point
, the value will be[x1, y1]
.The coordinates can be either clockwise or counterclockwise as long as it follows the order.
For example, given by the 4x4 pixel images below with annotation, the array will be:


Last updated
Was this helpful?