diff --git a/CHANGELOG.md b/CHANGELOG.md index d37eb74..7986c0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,7 +70,7 @@ Release - ```frame_data``` can only contain ```Num``` instances - ```object_data``` can not contain ```Num``` instances anymore - Major restructuring of the project directories -- ```FrameInterval.from_frame_uids()```: create ```FrameIntervals``` by providing a list of frame uids +- ```FrameInterval.from_frame_ids()```: create ```FrameIntervals``` by providing a list of frame uids - ```Object.object_data_pointers()```: generate ```ElementDataPointers``` - ```Scene.frame_intervals()```, ```Object.frame_intervals()```: generate ```FrameIntervals``` - ```Object.asdict()``` now provides also frame intervals and object data pointers, if the frames from the scene are provided diff --git a/raillabel/format/bbox.py b/raillabel/format/bbox.py index c07939a..6dddffb 100644 --- a/raillabel/format/bbox.py +++ b/raillabel/format/bbox.py @@ -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_uid: UUID + object_id: UUID "The uid of the object, this annotation belongs to." sensor: str @@ -33,12 +33,12 @@ class Bbox: "Additional information associated with the annotation." @classmethod - def from_json(cls, json: JSONBbox, object_uid: UUID) -> Bbox: + def from_json(cls, json: JSONBbox, object_id: UUID) -> Bbox: """Construct an instant of this class from RailLabel JSON data.""" return Bbox( pos=Point2d.from_json((json.val[0], json.val[1])), size=Size2d.from_json((json.val[2], json.val[3])), - object_uid=object_uid, + object_id=object_id, sensor=json.coordinate_system, attributes=_attributes_from_json(json.attributes), ) diff --git a/raillabel/format/cuboid.py b/raillabel/format/cuboid.py index 886ea3f..75d6d15 100644 --- a/raillabel/format/cuboid.py +++ b/raillabel/format/cuboid.py @@ -28,7 +28,7 @@ class Cuboid: size: Size3d "The size of the cuboid in meters." - object_uid: UUID + object_id: UUID "The uid of the object, this annotation belongs to." sensor: str @@ -38,13 +38,13 @@ class Cuboid: "Additional information associated with the annotation." @classmethod - def from_json(cls, json: JSONCuboid, object_uid: UUID) -> Cuboid: + def from_json(cls, json: JSONCuboid, object_id: UUID) -> Cuboid: """Construct an instant of this class from RailLabel JSON data.""" return 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_uid=object_uid, + object_id=object_id, sensor=json.coordinate_system, attributes=_attributes_from_json(json.attributes), ) diff --git a/raillabel/format/frame.py b/raillabel/format/frame.py index 168c658..182523b 100644 --- a/raillabel/format/frame.py +++ b/raillabel/format/frame.py @@ -90,21 +90,21 @@ def _annotations_from_json( annotations: dict[UUID, Bbox | Cuboid | Poly2d | Poly3d | Seg3d] = {} - for object_uid, object_data in json_object_data.items(): + for object_id, object_data in json_object_data.items(): for json_bbox in _resolve_none_to_empty_list(object_data.bbox): - annotations[json_bbox.uid] = Bbox.from_json(json_bbox, object_uid) + annotations[json_bbox.uid] = Bbox.from_json(json_bbox, object_id) for json_cuboid in _resolve_none_to_empty_list(object_data.cuboid): - annotations[json_cuboid.uid] = Cuboid.from_json(json_cuboid, object_uid) + annotations[json_cuboid.uid] = Cuboid.from_json(json_cuboid, object_id) for json_poly2d in _resolve_none_to_empty_list(object_data.poly2d): - annotations[json_poly2d.uid] = Poly2d.from_json(json_poly2d, object_uid) + annotations[json_poly2d.uid] = Poly2d.from_json(json_poly2d, object_id) for json_poly3d in _resolve_none_to_empty_list(object_data.poly3d): - annotations[json_poly3d.uid] = Poly3d.from_json(json_poly3d, object_uid) + annotations[json_poly3d.uid] = Poly3d.from_json(json_poly3d, object_id) for json_seg3d in _resolve_none_to_empty_list(object_data.vec): - annotations[json_seg3d.uid] = Seg3d.from_json(json_seg3d, object_uid) + annotations[json_seg3d.uid] = Seg3d.from_json(json_seg3d, object_id) return annotations diff --git a/raillabel/format/frame_interval.py b/raillabel/format/frame_interval.py index de0c851..6b9cd68 100644 --- a/raillabel/format/frame_interval.py +++ b/raillabel/format/frame_interval.py @@ -27,13 +27,13 @@ def from_json(cls, json: JSONFrameInterval) -> FrameInterval: ) @classmethod - def from_frame_uids(cls, frame_uids: list[int]) -> list[FrameInterval]: + def from_frame_ids(cls, frame_ids: list[int]) -> list[FrameInterval]: """Convert a list of frame uids into FrameIntervals. Example: ------- ```python - FrameInterval.from_frame_uids([0, 1, 2, 3, 9, 12, 13, 14]) == [ + FrameInterval.from_frame_ids([0, 1, 2, 3, 9, 12, 13, 14]) == [ FrameInterval(0, 3), FrameInterval(9, 9), FrameInterval(12, 14), @@ -41,11 +41,11 @@ def from_frame_uids(cls, frame_uids: list[int]) -> list[FrameInterval]: ``` """ - sorted_frame_uids = sorted(frame_uids) - frame_uid_intervals = _slice_into_intervals(sorted_frame_uids) + sorted_frame_ids = sorted(frame_ids) + frame_id_intervals = _slice_into_intervals(sorted_frame_ids) return [ - FrameInterval(start=interval[0], end=interval[-1]) for interval in frame_uid_intervals + FrameInterval(start=interval[0], end=interval[-1]) for interval in frame_id_intervals ] def to_json(self) -> JSONFrameInterval: @@ -60,23 +60,23 @@ def __len__(self) -> int: return abs(self.start - self.end) + 1 -def _slice_into_intervals(sorted_frame_uids: list[int]) -> list[list[int]]: - if len(sorted_frame_uids) == 0: +def _slice_into_intervals(sorted_frame_ids: list[int]) -> list[list[int]]: + if len(sorted_frame_ids) == 0: return [] - if len(sorted_frame_uids) == 1: - return [sorted_frame_uids] + if len(sorted_frame_ids) == 1: + return [sorted_frame_ids] intervals = [] interval_start_i = 0 - for i, frame_uid in enumerate(sorted_frame_uids[1:]): - previous_frame_uid = sorted_frame_uids[i] + for i, frame_id in enumerate(sorted_frame_ids[1:]): + previous_frame_id = sorted_frame_ids[i] - if frame_uid - previous_frame_uid > 1: - intervals.append(sorted_frame_uids[interval_start_i : i + 1]) + if frame_id - previous_frame_id > 1: + intervals.append(sorted_frame_ids[interval_start_i : i + 1]) interval_start_i = i + 1 - intervals.append(sorted_frame_uids[interval_start_i : len(sorted_frame_uids)]) - interval_start_i = len(sorted_frame_uids) + intervals.append(sorted_frame_ids[interval_start_i : len(sorted_frame_ids)]) + interval_start_i = len(sorted_frame_ids) return intervals diff --git a/raillabel/format/poly2d.py b/raillabel/format/poly2d.py index cbf5b6f..c89e530 100644 --- a/raillabel/format/poly2d.py +++ b/raillabel/format/poly2d.py @@ -22,7 +22,7 @@ class Poly2d: closed: bool "If True, this object represents a polygon and if False, it represents a polyline." - object_uid: UUID + object_id: UUID "The uid of the object, this annotation belongs to." sensor: str @@ -32,7 +32,7 @@ class Poly2d: "Additional information associated with the annotation." @classmethod - def from_json(cls, json: JSONPoly2d, object_uid: UUID) -> Poly2d: + def from_json(cls, json: JSONPoly2d, object_id: UUID) -> Poly2d: """Construct an instant of this class from RailLabel JSON data.""" return Poly2d( points=[ @@ -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_uid=object_uid, + object_id=object_id, sensor=json.coordinate_system, attributes=_attributes_from_json(json.attributes), ) diff --git a/raillabel/format/poly3d.py b/raillabel/format/poly3d.py index 3561d61..aa801ee 100644 --- a/raillabel/format/poly3d.py +++ b/raillabel/format/poly3d.py @@ -22,7 +22,7 @@ class Poly3d: closed: bool "If True, this object represents a polygon and if False, it represents a polyline." - object_uid: UUID + object_id: UUID "The uid of the object, this annotation belongs to." sensor: str @@ -32,7 +32,7 @@ class Poly3d: "Additional information associated with the annotation." @classmethod - def from_json(cls, json: JSONPoly3d, object_uid: UUID) -> Poly3d: + def from_json(cls, json: JSONPoly3d, object_id: UUID) -> Poly3d: """Construct an instant of this class from RailLabel JSON data.""" return Poly3d( points=[ @@ -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_uid=object_uid, + object_id=object_id, sensor=json.coordinate_system, attributes=_attributes_from_json(json.attributes), ) diff --git a/raillabel/format/scene.py b/raillabel/format/scene.py index 3c1b03e..c88f4a5 100644 --- a/raillabel/format/scene.py +++ b/raillabel/format/scene.py @@ -87,11 +87,11 @@ def _objects_from_json(json_objects: dict[UUID, JSONObject] | None) -> dict[UUID if json_objects is None: return {} - return {obj_uid: Object.from_json(json_obj) for obj_uid, json_obj in json_objects.items()} + return {obj_id: Object.from_json(json_obj) for obj_id, json_obj in json_objects.items()} def _frames_from_json(json_frames: dict[int, JSONFrame] | None) -> dict[int, Frame]: if json_frames is None: return {} - return {frame_uid: Frame.from_json(json_frame) for frame_uid, json_frame in json_frames.items()} + return {frame_id: Frame.from_json(json_frame) for frame_id, json_frame in json_frames.items()} diff --git a/raillabel/format/seg3d.py b/raillabel/format/seg3d.py index c201f4f..d040237 100644 --- a/raillabel/format/seg3d.py +++ b/raillabel/format/seg3d.py @@ -18,7 +18,7 @@ class Seg3d: point_ids: list[int] "The list of point indices." - object_uid: UUID + object_id: UUID "The uid of the object, this annotation belongs to." sensor: str @@ -28,11 +28,11 @@ class Seg3d: "Additional information associated with the annotation." @classmethod - def from_json(cls, json: JSONVec, object_uid: UUID) -> Seg3d: + def from_json(cls, json: JSONVec, object_id: 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_uid=object_uid, + object_id=object_id, sensor=json.coordinate_system, attributes=_attributes_from_json(json.attributes), ) diff --git a/tests/__test_assets__/openlabel_v1_schema.json b/tests/__test_assets__/openlabel_v1_schema.json index 45997a6..8d0021e 100644 --- a/tests/__test_assets__/openlabel_v1_schema.json +++ b/tests/__test_assets__/openlabel_v1_schema.json @@ -24,12 +24,12 @@ "description": "Name of the action. It is a friendly name and not used for indexing.", "type": "string" }, - "ontology_uid": { + "ontology_id": { "description": "This is the UID of the ontology where the type of this action is defined.", "type": "string" }, - "resource_uid": { - "$ref": "#/definitions/resource_uid" + "resource_id": { + "$ref": "#/definitions/resource_id" }, "type": { "description": "The type of an action defines the class the action corresponds to.", @@ -253,12 +253,12 @@ "description": "Name of the context. It is a friendly name and not used for indexing.", "type": "string" }, - "ontology_uid": { + "ontology_id": { "description": "This is the UID of the ontology where the type of this context is defined.", "type": "string" }, - "resource_uid": { - "$ref": "#/definitions/resource_uid" + "resource_id": { + "$ref": "#/definitions/resource_id" }, "type": { "description": "The type of a context defines the class the context corresponds to.", @@ -469,12 +469,12 @@ "description": "Name of the event. It is a friendly name and not used for indexing.", "type": "string" }, - "ontology_uid": { + "ontology_id": { "description": "This is the UID of the ontology where the type of this event is defined.", "type": "string" }, - "resource_uid": { - "$ref": "#/definitions/resource_uid" + "resource_id": { + "$ref": "#/definitions/resource_id" }, "type": { "description": "The type of an event defines the class the event corresponds to.", @@ -907,12 +907,12 @@ "object_data_pointers": { "$ref": "#/definitions/element_data_pointers" }, - "ontology_uid": { + "ontology_id": { "description": "This is the UID of the ontology where the type of this object is defined.", "type": "string" }, - "resource_uid": { - "$ref": "#/definitions/resource_uid" + "resource_id": { + "$ref": "#/definitions/resource_id" }, "type": { "description": "The type of an object defines the class the object corresponds to.", @@ -1427,7 +1427,7 @@ "description": "Name of the relation. It is a friendly name and not used for indexing.", "type": "string" }, - "ontology_uid": { + "ontology_id": { "description": "This is the UID of the ontology where the type of this relation is defined.", "type": "string" }, @@ -1445,8 +1445,8 @@ }, "type": "array" }, - "resource_uid": { - "$ref": "#/definitions/resource_uid" + "resource_id": { + "$ref": "#/definitions/resource_id" }, "type": { "description": "The type of a relation defines the class the predicated of the relation corresponds to.", @@ -1461,8 +1461,8 @@ ], "type": "object" }, - "resource_uid": { - "description": "This is a JSON object that contains links to external resources. Resource_uid keys are strings containing numerical UIDs or 32 bytes UUIDs. Resource_uid values are strings describing the identifier of the element in the external resource.", + "resource_id": { + "description": "This is a JSON object that contains links to external resources. Resource_id keys are strings containing numerical UIDs or 32 bytes UUIDs. Resource_id values are strings describing the identifier of the element in the external resource.", "patternProperties": { "^(-?[0-9]+|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$": { "type": "string" @@ -1652,12 +1652,12 @@ "additionalProperties": true, "description": "A tag is a special type of label that can be attached to any type of content, such as images, data containers, folders. In ASAM OpenLABEL the main purpose of a tag is to allow adding metadata to scenario descriptions.", "properties": { - "ontology_uid": { + "ontology_id": { "description": "This is the UID of the ontology where the type of this tag is defined.", "type": "string" }, - "resource_uid": { - "$ref": "#/definitions/resource_uid" + "resource_id": { + "$ref": "#/definitions/resource_id" }, "tag_data": { "$ref": "#/definitions/tag_data" @@ -1668,7 +1668,7 @@ } }, "required": [ - "ontology_uid", + "ontology_id", "type" ], "type": "object" diff --git a/tests/test_raillabel/format/conftest.py b/tests/test_raillabel/format/conftest.py index b51eafb..0bc295a 100644 --- a/tests/test_raillabel/format/conftest.py +++ b/tests/test_raillabel/format/conftest.py @@ -1,9 +1,9 @@ # Copyright DB InfraGO AG and contributors # SPDX-License-Identifier: Apache-2.0 from .test_attributes import attributes_multiple_types, attributes_multiple_types_json -from .test_bbox import bbox, bbox_json, bbox_uid +from .test_bbox import bbox, bbox_json, bbox_id from .test_camera import camera, camera_json -from .test_cuboid import cuboid, cuboid_json, cuboid_uid +from .test_cuboid import cuboid, cuboid_json, cuboid_id from .test_frame import frame, frame_json from .test_frame_interval import frame_interval, frame_interval_json from .test_intrinsics_pinhole import intrinsics_pinhole, intrinsics_pinhole_json @@ -14,20 +14,20 @@ from .test_object import ( object_person, object_person_json, - object_person_uid, + object_person_id, object_track, object_track_json, - object_track_uid, + object_track_id, ) from .test_point2d import point2d, point2d_json, another_point2d, another_point2d_json from .test_point3d import point3d, point3d_json, another_point3d, another_point3d_json -from .test_poly2d import poly2d, poly2d_json, poly2d_uid -from .test_poly3d import poly3d, poly3d_json, poly3d_uid +from .test_poly2d import poly2d, poly2d_json, poly2d_id +from .test_poly3d import poly3d, poly3d_json, poly3d_id from .test_quaternion import quaternion, quaternion_json from .test_radar import radar, radar_json from .test_size2d import size2d, size2d_json from .test_size3d import size3d, size3d_json -from .test_seg3d import seg3d, seg3d_json, seg3d_uid +from .test_seg3d import seg3d, seg3d_json, seg3d_id from .test_sensor_reference import ( another_sensor_reference, another_sensor_reference_json, diff --git a/tests/test_raillabel/format/test_bbox.py b/tests/test_raillabel/format/test_bbox.py index a22a368..cc534e0 100644 --- a/tests/test_raillabel/format/test_bbox.py +++ b/tests/test_raillabel/format/test_bbox.py @@ -29,7 +29,7 @@ def bbox_json( @pytest.fixture -def bbox_uid() -> UUID: +def bbox_id() -> UUID: return UUID("2811f67c-124C-4fac-a275-20807d0471de") @@ -38,22 +38,22 @@ def bbox( point2d, size2d, attributes_multiple_types, - object_person_uid, + object_person_id, ) -> Bbox: return Bbox( pos=point2d, size=size2d, sensor="rgb_middle", attributes=attributes_multiple_types, - object_uid=object_person_uid, + object_id=object_person_id, ) # == Tests ============================ -def test_from_json(bbox, bbox_json, object_person_uid): - actual = Bbox.from_json(bbox_json, object_person_uid) +def test_from_json(bbox, bbox_json, object_person_id): + actual = Bbox.from_json(bbox_json, object_person_id) assert actual == bbox @@ -62,8 +62,8 @@ def test_name(bbox): assert actual == "rgb_middle__bbox__person" -def test_to_json(bbox, bbox_json, bbox_uid): - actual = bbox.to_json(bbox_uid, object_type="person") +def test_to_json(bbox, bbox_json, bbox_id): + actual = bbox.to_json(bbox_id, object_type="person") assert actual == bbox_json diff --git a/tests/test_raillabel/format/test_cuboid.py b/tests/test_raillabel/format/test_cuboid.py index 7d6614b..ce7bfe8 100644 --- a/tests/test_raillabel/format/test_cuboid.py +++ b/tests/test_raillabel/format/test_cuboid.py @@ -30,7 +30,7 @@ def cuboid_json( @pytest.fixture -def cuboid_uid() -> UUID: +def cuboid_id() -> UUID: return UUID("51def938-20BA-4699-95be-d6330c44cb77") @@ -40,7 +40,7 @@ def cuboid( size3d, quaternion, attributes_multiple_types, - object_person_uid, + object_person_id, ) -> Cuboid: return Cuboid( pos=point3d, @@ -48,15 +48,15 @@ def cuboid( size=size3d, sensor="lidar", attributes=attributes_multiple_types, - object_uid=object_person_uid, + object_id=object_person_id, ) # == Tests ============================ -def test_from_json(cuboid, cuboid_json, object_person_uid): - actual = Cuboid.from_json(cuboid_json, object_person_uid) +def test_from_json(cuboid, cuboid_json, object_person_id): + actual = Cuboid.from_json(cuboid_json, object_person_id) assert actual == cuboid diff --git a/tests/test_raillabel/format/test_frame.py b/tests/test_raillabel/format/test_frame.py index 26af71d..44814c1 100644 --- a/tests/test_raillabel/format/test_frame.py +++ b/tests/test_raillabel/format/test_frame.py @@ -53,15 +53,15 @@ def frame( another_sensor_reference, num, bbox, - bbox_uid, + bbox_id, cuboid, - cuboid_uid, + cuboid_id, poly2d, - poly2d_uid, + poly2d_id, poly3d, - poly3d_uid, + poly3d_id, seg3d, - seg3d_uid, + seg3d_id, ) -> dict: return Frame( timestamp=Decimal("1631337747.123123123"), @@ -71,11 +71,11 @@ def frame( }, frame_data={num.name: num}, annotations={ - bbox_uid: bbox, - cuboid_uid: cuboid, - poly2d_uid: poly2d, - poly3d_uid: poly3d, - seg3d_uid: seg3d, + bbox_id: bbox, + cuboid_id: cuboid, + poly2d_id: poly2d, + poly3d_id: poly3d, + seg3d_id: seg3d, }, ) diff --git a/tests/test_raillabel/format/test_frame_interval.py b/tests/test_raillabel/format/test_frame_interval.py index 4508421..7633ec7 100644 --- a/tests/test_raillabel/format/test_frame_interval.py +++ b/tests/test_raillabel/format/test_frame_interval.py @@ -41,28 +41,28 @@ def test_len(): assert len(frame_interval) == 5 -def test_from_frame_uids_empty(): - frame_uids = [] +def test_from_frame_ids_empty(): + frame_ids = [] - assert FrameInterval.from_frame_uids(frame_uids) == [] + assert FrameInterval.from_frame_ids(frame_ids) == [] -def test_from_frame_uids_one_frame(): - frame_uids = [1] +def test_from_frame_ids_one_frame(): + frame_ids = [1] - assert FrameInterval.from_frame_uids(frame_uids) == [FrameInterval(1, 1)] + assert FrameInterval.from_frame_ids(frame_ids) == [FrameInterval(1, 1)] -def test_from_frame_uids_one_interval(): - frame_uids = [1, 2, 3, 4] +def test_from_frame_ids_one_interval(): + frame_ids = [1, 2, 3, 4] - assert FrameInterval.from_frame_uids(frame_uids) == [FrameInterval(1, 4)] + assert FrameInterval.from_frame_ids(frame_ids) == [FrameInterval(1, 4)] -def test_from_frame_uids_multiple_intervals(): - frame_uids = [0, 1, 2, 3, 6, 7, 9, 12, 13, 14] +def test_from_frame_ids_multiple_intervals(): + frame_ids = [0, 1, 2, 3, 6, 7, 9, 12, 13, 14] - assert FrameInterval.from_frame_uids(frame_uids) == [ + assert FrameInterval.from_frame_ids(frame_ids) == [ FrameInterval(0, 3), FrameInterval(6, 7), FrameInterval(9, 9), @@ -70,10 +70,10 @@ def test_from_frame_uids_multiple_intervals(): ] -def test_from_frame_uids_unsorted(): - frame_uids = [5, 2, 1, 3] +def test_from_frame_ids_unsorted(): + frame_ids = [5, 2, 1, 3] - assert FrameInterval.from_frame_uids(frame_uids) == [ + assert FrameInterval.from_frame_ids(frame_ids) == [ FrameInterval(1, 3), FrameInterval(5, 5), ] diff --git a/tests/test_raillabel/format/test_object.py b/tests/test_raillabel/format/test_object.py index 0f94c7a..ae6b0da 100644 --- a/tests/test_raillabel/format/test_object.py +++ b/tests/test_raillabel/format/test_object.py @@ -30,7 +30,7 @@ def object_person() -> Object: @pytest.fixture -def object_person_uid() -> UUID: +def object_person_id() -> UUID: return UUID("b40ba3ad-0327-46ff-9c28-2506cfd6d934") @@ -51,7 +51,7 @@ def object_track() -> Object: @pytest.fixture -def object_track_uid() -> UUID: +def object_track_id() -> UUID: return UUID("cfcf9750-3BC3-4077-9079-a82c0c63976a") diff --git a/tests/test_raillabel/format/test_poly2d.py b/tests/test_raillabel/format/test_poly2d.py index 8ead75a..b91a7aa 100644 --- a/tests/test_raillabel/format/test_poly2d.py +++ b/tests/test_raillabel/format/test_poly2d.py @@ -31,7 +31,7 @@ def poly2d_json( @pytest.fixture -def poly2d_uid() -> UUID: +def poly2d_id() -> UUID: return UUID("013e7b34-62E5-435c-9412-87318c50f6d8") @@ -40,22 +40,22 @@ def poly2d( point2d, another_point2d, attributes_multiple_types, - object_track_uid, + object_track_id, ) -> Poly2d: return Poly2d( points=[point2d, another_point2d], closed=True, sensor="rgb_middle", attributes=attributes_multiple_types, - object_uid=object_track_uid, + object_id=object_track_id, ) # == Tests ============================ -def test_from_json(poly2d, poly2d_json, object_track_uid): - actual = Poly2d.from_json(poly2d_json, object_track_uid) +def test_from_json(poly2d, poly2d_json, object_track_id): + actual = Poly2d.from_json(poly2d_json, object_track_id) assert actual == poly2d diff --git a/tests/test_raillabel/format/test_poly3d.py b/tests/test_raillabel/format/test_poly3d.py index a3f3b75..b8752d0 100644 --- a/tests/test_raillabel/format/test_poly3d.py +++ b/tests/test_raillabel/format/test_poly3d.py @@ -30,7 +30,7 @@ def poly3d_json( @pytest.fixture -def poly3d_uid() -> UUID: +def poly3d_id() -> UUID: return UUID("0da87210-46F1-40e5-b661-20ea1c392f50") @@ -39,22 +39,22 @@ def poly3d( point3d, another_point3d, attributes_multiple_types, - object_track_uid, + object_track_id, ) -> Poly3d: return Poly3d( points=[point3d, another_point3d], closed=True, sensor="lidar", attributes=attributes_multiple_types, - object_uid=object_track_uid, + object_id=object_track_id, ) # == Tests ============================ -def test_from_json(poly3d, poly3d_json, object_track_uid): - actual = Poly3d.from_json(poly3d_json, object_track_uid) +def test_from_json(poly3d, poly3d_json, object_track_id): + actual = Poly3d.from_json(poly3d_json, object_track_id) assert actual == poly3d diff --git a/tests/test_raillabel/format/test_scene.py b/tests/test_raillabel/format/test_scene.py index ea2539f..c8a0f63 100644 --- a/tests/test_raillabel/format/test_scene.py +++ b/tests/test_raillabel/format/test_scene.py @@ -17,9 +17,9 @@ def scene_json( camera_json, lidar_json, radar_json, - object_person_uid, + object_person_id, object_person_json, - object_track_uid, + object_track_id, object_track_json, frame_json, ) -> JSONScene: @@ -43,8 +43,8 @@ def scene_json( "radar": radar_json[0], }, objects={ - object_person_uid: object_person_json, - object_track_uid: object_track_json, + object_person_id: object_person_json, + object_track_id: object_track_json, }, frames={1: frame_json}, ) @@ -57,9 +57,9 @@ def scene( camera, lidar, radar, - object_person_uid, + object_person_id, object_person, - object_track_uid, + object_track_id, object_track, frame, ) -> Scene: @@ -71,8 +71,8 @@ def scene( "radar": radar, }, objects={ - object_person_uid: object_person, - object_track_uid: object_track, + object_person_id: object_person, + object_track_id: object_track, }, frames={1: frame}, ) diff --git a/tests/test_raillabel/format/test_seg3d.py b/tests/test_raillabel/format/test_seg3d.py index 24a3853..8be83c6 100644 --- a/tests/test_raillabel/format/test_seg3d.py +++ b/tests/test_raillabel/format/test_seg3d.py @@ -27,28 +27,28 @@ def seg3d_json( @pytest.fixture -def seg3d_uid() -> UUID: +def seg3d_id() -> UUID: return UUID("d52e2b25-0B48-4899-86d5-4bc41be6b7d3") @pytest.fixture def seg3d( attributes_multiple_types, - object_person_uid, + object_person_id, ) -> Seg3d: return Seg3d( point_ids=[1234, 5678], sensor="lidar", attributes=attributes_multiple_types, - object_uid=object_person_uid, + object_id=object_person_id, ) # == Tests ============================ -def test_from_json(seg3d, seg3d_json, object_person_uid): - actual = Seg3d.from_json(seg3d_json, object_person_uid) +def test_from_json(seg3d, seg3d_json, object_person_id): + actual = Seg3d.from_json(seg3d_json, object_person_id) assert actual == seg3d