Annotation
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
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: 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:
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: Type of the vector object, currently supports polygon
, boundingBox
, path
and point
.
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: