Skip to content

Commit

Permalink
refactor: extract all parent class information from Bbox
Browse files Browse the repository at this point in the history
  • Loading branch information
tklockau committed Nov 11, 2024
1 parent fee3aff commit fb36164
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions raillabel/format/bbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
from __future__ import annotations

from dataclasses import dataclass
from uuid import UUID

from ._object_annotation import _ObjectAnnotation
from .point2d import Point2d
from .size2d import Size2d


@dataclass
class Bbox(_ObjectAnnotation):
class Bbox:
"""A 2D bounding box in an image.
Parameters
Expand All @@ -38,6 +38,15 @@ class Bbox(_ObjectAnnotation):
"""

pos: Point2d
"The center point of the bbox in pixels."

size: Size2d
"The dimensions of the bbox in pixels from the top left corner to the bottom right corner."

object: UUID
"The uid of the object, this annotation belongs to."

sensor: str
"The uid of the sensor, this annotation is labeled in."

OPENLABEL_ID = "bbox"
attributes: dict[str, int | float | bool | str | list]

0 comments on commit fb36164

Please sign in to comment.