raillabel.format.bbox module

class raillabel.format.bbox.Bbox(pos: Point2d, size: Size2d, object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])

Bases: object

A 2D bounding box in an image.

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

Additional information associated with the annotation.

classmethod from_json(json: JSONBbox, object_id: UUID) Bbox

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.

pos: Point2d

The center point of the bbox in pixels.

sensor_id: str

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

size: Size2d

The dimensions of the bbox in pixels from the top left corner to the bottom right corner.

to_json(uid: UUID, object_type: str) JSONBbox

Export this object into the RailLabel JSON format.