Skip to content

Commit

Permalink
refactor: rename object field to object_uid in Annotation classes
Browse files Browse the repository at this point in the history
  • Loading branch information
unexcellent committed Nov 13, 2024
1 parent b1ebe26 commit f6bd567
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions raillabel/format/bbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Bbox:
size: Size2d
"The dimensions of the bbox in pixels from the top left corner to the bottom right corner."

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

sensor: str
Expand All @@ -38,7 +38,7 @@ def from_json(cls, json: JSONBbox, object_uid: UUID) -> Bbox:
return Bbox(
pos=Point2d.from_json((json.val[0], json.val[1])),
size=Size2d.from_json((json.val[2], json.val[3])),
object=object_uid,
object_uid=object_uid,
sensor=json.coordinate_system,
attributes=_attributes_from_json(json.attributes),
)
Expand Down
4 changes: 2 additions & 2 deletions raillabel/format/cuboid.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Cuboid:
size: Size3d
"The size of the cuboid in meters."

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

sensor: str
Expand All @@ -44,7 +44,7 @@ def from_json(cls, json: JSONCuboid, object_uid: UUID) -> Cuboid:
pos=Point3d.from_json((json.val[0], json.val[1], json.val[2])),
quat=Quaternion.from_json((json.val[3], json.val[4], json.val[5], json.val[6])),
size=Size3d.from_json((json.val[7], json.val[8], json.val[9])),
object=object_uid,
object_uid=object_uid,
sensor=json.coordinate_system,
attributes=_attributes_from_json(json.attributes),
)
Expand Down
4 changes: 2 additions & 2 deletions raillabel/format/poly2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Poly2d:
closed: bool
"If True, this object represents a polygon and if False, it represents a polyline."

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

sensor: str
Expand All @@ -40,7 +40,7 @@ def from_json(cls, json: JSONPoly2d, object_uid: UUID) -> Poly2d:
for i in range(0, len(json.val), 2)
],
closed=json.closed,
object=object_uid,
object_uid=object_uid,
sensor=json.coordinate_system,
attributes=_attributes_from_json(json.attributes),
)
Expand Down
4 changes: 2 additions & 2 deletions raillabel/format/poly3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Poly3d:
closed: bool
"If True, this object represents a polygon and if False, it represents a polyline."

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

sensor: str
Expand All @@ -40,7 +40,7 @@ def from_json(cls, json: JSONPoly3d, object_uid: UUID) -> Poly3d:
for i in range(0, len(json.val), 3)
],
closed=json.closed,
object=object_uid,
object_uid=object_uid,
sensor=json.coordinate_system,
attributes=_attributes_from_json(json.attributes),
)
Expand Down
4 changes: 2 additions & 2 deletions raillabel/format/seg3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Seg3d:
point_ids: list[int]
"The list of point indices."

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

sensor: str
Expand All @@ -32,7 +32,7 @@ def from_json(cls, json: JSONVec, object_uid: UUID) -> Seg3d:
"""Construct an instant of this class from RailLabel JSON data."""
return Seg3d(
point_ids=[int(point_id) for point_id in json.val],
object=object_uid,
object_uid=object_uid,
sensor=json.coordinate_system,
attributes=_attributes_from_json(json.attributes),
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_raillabel/format/test_bbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def bbox(
size=size2d,
sensor="rgb_middle",
attributes=attributes_multiple_types,
object=object_person_uid,
object_uid=object_person_uid,
)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_raillabel/format/test_cuboid.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def cuboid(
size=size3d,
sensor="lidar",
attributes=attributes_multiple_types,
object=object_person_uid,
object_uid=object_person_uid,
)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_raillabel/format/test_poly2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def poly2d(
closed=True,
sensor="rgb_middle",
attributes=attributes_multiple_types,
object=object_track_uid,
object_uid=object_track_uid,
)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_raillabel/format/test_poly3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def poly3d(
closed=True,
sensor="lidar",
attributes=attributes_multiple_types,
object=object_track_uid,
object_uid=object_track_uid,
)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_raillabel/format/test_seg3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def seg3d(
point_ids=[1234, 5678],
sensor="lidar",
attributes=attributes_multiple_types,
object=object_person_uid,
object_uid=object_person_uid,
)


Expand Down

0 comments on commit f6bd567

Please sign in to comment.