Lines

Given a line entry in params.geometries, Scale will annotate your image or video with polylines (segmented lines) and return the vertices of the lines.

Request Parameters

Parameter

Type

Default

Description

objects_to_annotate

array

[]

A list of string or LabelDescription objects.

min_vertices

integer

1

The minimum number of vertices in a valid line annotation for your request.

max_vertices

integer

null

The maximum number of vertices in a valid line annotation for your request. Must be at least min_vertices.

{
  "geometries": {
    "line": {
      "objects_to_annotate": [
        "unmarked_lane",
        {
          "choice": "marked lanes",
          "subchoices": [
            "solid",
            {
              "choice": "dashed",
              "display": "dashed or dotted"
            }
          ]
        },
        "shoulder"
      ],
      "min_vertices": 2,
      "max_vertices": 15
    },
    ...
  },
  ...
}

Response Fields

Key

Type

Description

uuid

string

A computer-generated unique identifier for this annotation.

In video annotation tasks, this can be used to track the same object across frames.

type

string

String to indicate geometry type: line

label

string

The label of this annotation, chosen from the objects_to_annotate array for its geometry. In video annotation tasks, any annotation objects with the same uuid will have the same label across all frames.

attributes

object

See the Annotation Attributes section for more details about the attributes response field.

vertices

array

An array of vertex objects describing the vertices of the polygon, listed in the order they were annotated. In other words, the point order will be either clockwise or counter-clockwise for each annotation.

Definition: Vertex

Key

Type

Description

x

number

The distance, in pixels, between the vertex and the left border of the image.

y

number

The distance, in pixels, between the vertex and the top border of the image.

{
  "response": {
    "annotations": [
      {
        "type": "line",
        "label": "solid line",
        "vertices": [
            {
                "x": 123,
                "y": 10
            },
            {
                "x": 140,
                "y": 49
            },
            {
                "x": 67,
                "y": 34
            }
        ],
        "uuid": "65ec1f52-5902-4b39-bea9-ab6b4d58ef42"
      },
      { ... },
      { ... }
    ]
  },
  "task_id": "5774cc78b01249ab09f089dd",
  "task": {
    // populated task for convenience
    ...
  }
}