Polyline

Polylines are useful for tasks such as lane and horizon marking.

Import

Python SDK

Line is a type of ObjectAnnotation

Definition

Line(points=list(Points(x,y))

ParameterValue
pointsList of Points

Supported data types

Data typeSupported
ImageYes
Tiled imageryYes
ObjectAnnotation(
  name = "polyline",
  value = Line(points=[Point(x=10, y=10), Point(x=0, y=10), Point(x=10, y=10)]),
)
## Coordinates in the desired EPSG coordinate system
line_points = list([Point(x=-99.21052827588443, y=19.405662413477728), Point(x=-99.20534818927473, y=19.400498983095076), Point(x=-100.505348189274754, y=29.400498983095045)])

ObjectAnnotation(
  name = "polygon_geospatial",
  value = Line(points=line_points),
)

Format convertors

MethodUsageComments
from_shapely()Line.from_shapely(shapely_object)Transforms a shapely object. Learn more about shapely

NDJSON

NDJSON format is recommended if an annotation type is not yet supported in Python SDK or if you are unable to use the Python environment.

Definition

ParameterAsset typeRequiredDescription
uuidImage
Tiled imagery
YesA user-generated UUID for each annotation. If you import an annotation to a Data Row and there is already an imported annotation with the same uuid on that Data Row, the latest import will override the previous one. The uuid must be 128 bits (32 characters). The following formats are supported:

- A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11

- {a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11}

- a0eebc999c0b4ef8bb6d6bb9bd380a11

- a0ee-bc99-9c0b-4ef8-bb6d-6bb9-bd38-0a11

- {a0eebc99-9c0b4ef8-bb6d6bb9-bd380a11}
schemaIdImage
Tiled imagery
YesThe ID of the schema that contains all of the information needed for rendering your annotation.
dataRow.idImage
Tiled imagery
YesThe ID of the Data Row where you want to attach the imported annotations.
line.xImage
Tiled imagery
Yesx-coordinate for a single point on the Polyline annotation.
line.yImage
Tiled imagery
Yesy-coordinate for a single point on the Polyline annotation.

Supported data types

Data typeSupported
ImageYes
Tiled imageryYes

Format

{
    "uuid": "62e1d949-1c75-47f6-9ea2-e938da17d37c",
    "schemaId": "ck68grts29n7z08903nvgaim5",
    "dataRow": { 
        "id": "cjxav5aa07r1g0dsq70t9eveg" 
    }, 
    "line": [ 
        { 
            "x": 58, 
            "y": 148 
        }, 
        { 
            "x": 135, 
            "y": 79 
        }, 
        { 
            "x": 53, 
            "y": 191 
        } 
    ]
}
{
    "uuid": "1b5762e9-416c-44cf-9a5f-07effb51f863",
    "schemaId": "ck67grts29n7y0890q89jdcyp",
    "dataRow": {
        "id": "cjxav4aa07r1g0dsq70t9eveg"
    },
    "line": [
        {
            "x": -99.21052827588443,
            "y": 19.405662413477728
        },
        {
            "x": -99.20534818927473,
            "y": 19.400498983095076
        },
        {
            "x": -100.505348189274754,
            "y": 29.400498983095045
        }
    ]
}

Export

When you export your Polyline annotations from Labelbox, the export file will contain the following information for each Polyline.

Python SDK

The export format of the polygon is similar to the import format.

Learn more about exporting annotations using the SDK here

JSON

You will receive a JSON file when you generate an export from the app.

ParameterAsset typeDescription
schemaIdImage
Video
Tiled imagery
The ID of the schema containing all of the information needed for rendering your annotation.
featureIdImage
Video
Tiled imagery
ID of the annotation.
titleImage
Video
Tiled imagery
Name of the annotation in the ontology.
colorImage
Video
Tiled imagery
Color of the annotation in the ontology.
line.xImage
Video
x coordinate for a single point on the Polyline annotation.
line.yImage
Video
y coordinate for a single point on the Polyline annotation.
instanceURIImageAnnotation information hosted on Labelbox servers.
typeTiled imageryAnnotation type. Value should be polyline.
geometry.coordinatesTiled imageryLongitude and latitude, in that order.

Format

{
    "featureId": "ckmuuwb1p00073g68vg3t615r",
    "schemaId": "ckmuuvs5r5njc0y623c4s1dob",
    "title": "Tree branch",
    "value": "tree_branch",
    "color": "#008941",
    "line": [
        {
            "x": 198.027,
            "y": 1979.196
        },
        {
            "x": 321.472,
            "y": 1801.743
        },
        {
            "x": 465.491,
            "y": 1655.152
        }
    ],
}
{
    "featureId": "ckt37btlp00063h6b8srqrsr8",
    "schemaId": "ckt09rb8q7zsu0yc24y3w85m5",
    "title": "Center lane",
    "value": "center_lane",
    "color": "#2f05f1",
    "keyframe": true,
    "line": [{
            "x": 661.215,
            "y": 2146.298
        },
        {
            "x": 961.767,
            "y": 1907.624
        },
        {
            "x": 1262.32,
            "y": 1668.95
        }
    ],
    "classifications": []
}
{
    "featureId": "ckossvrll00033h68tczgb8p9",
    "schemaId": "ckosstz24fhci0yag63j377hz",
    "title": "line",
    "value": "line",
    "color": "#FF34FF",
    "type": "polyline",
    "geometry": {
        "coordinates": [
            [
                151.20330452874953,
                -33.866105019363175
            ],
            [
                151.20364785147953,
                -33.866737933344254
            ]
        ]
    }
}
{ // This is from the frame data of the DICOM file for one of the axes
    "frameNumber": 185,
    "classifications": [],
    "objects": [
        {
            "featureId": "cl2y5hjr200073g6cidkf0pqj",
            "schemaId": "ckzohkul206420z974x2q4a9h",
            "title": "Tool 2",
            "value": "tool_2",
            "color": "#FF34FF",
            "keyframe": true,
            "line": [
                {
                    "x": 95.237,
                    "y": 117.232
                },
                {
                    "x": 223.735,
                    "y": 196
                },
                {
                    "x": 262.608,
                    "y": 124.785
                }
            ],
            "classifications": []
        }
    ],
    "relationships": []
}