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))
Parameter | Value |
---|---|
| List of Points |
Supported data types
Data type | Supported |
---|---|
Image | Yes |
Tiled imagery | Yes |
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
Method | Usage | Comments |
---|---|---|
|
| 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
Parameter | Asset type | Required | Description |
---|---|---|---|
| Image | Yes | A 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:
|
| Image | Yes | The ID of the schema that contains all of the information needed for rendering your annotation. |
| Image | Yes | The ID of the Data Row where you want to attach the imported annotations. |
| Image | Yes | x-coordinate for a single point on the Polyline annotation. |
| Image | Yes | y-coordinate for a single point on the Polyline annotation. |
Supported data types
Data type | Supported |
---|---|
Image | Yes |
Tiled imagery | Yes |
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.
Parameter | Asset type | Description |
---|---|---|
| Image | The ID of the schema containing all of the information needed for rendering your annotation. |
| Image | ID of the annotation. |
| Image | Name of the annotation in the ontology. |
| Image | Color of the annotation in the ontology. |
| Image | x coordinate for a single point on the Polyline annotation. |
| Image | y coordinate for a single point on the Polyline annotation. |
| Image | Annotation information hosted on Labelbox servers. |
| Tiled imagery | Annotation type. Value should be |
| Tiled imagery | Longitude 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": []
}