raillabel.format.poly2d module

class raillabel.format.poly2d.Poly2d(points: list[Point2d], closed: bool, object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])

Bases: object

Sequence of 2D points. Can either be a polygon or polyline.

attributes: dict[str, float | bool | str | list]

Additional information associated with the annotation.

closed: bool

If True, this object represents a polygon and if False, it represents a polyline.

classmethod from_json(json: JSONPoly2d, object_id: UUID) Poly2d

Construct an instant of this class from RailLabel JSON data.

name(object_type: str) str

Return the name of the annotation used for indexing in the object data pointers.

object_id: UUID

The unique identifyer of the real-life object, this annotation belongs to.

points: list[Point2d]

List of the 2d points that make up the polyline.

sensor_id: str

The unique identifyer of the sensor this annotation is labeled in.

to_json(uid: UUID, object_type: str) JSONPoly2d

Export this object into the RailLabel JSON format.