Skip to content

Commit dc77bd1

Browse files
authored
refactor: remove unused projection parameter (#210)
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
1 parent 1b0c0e4 commit dc77bd1

3 files changed

Lines changed: 4 additions & 13 deletions

File tree

docs/tutorials/render.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ To initialize `RerunViewer`, you can use the `ViewerBuilder` class:
7171
>>> viewer = (
7272
ViewerBuilder()
7373
.with_spatial3d()
74-
.with_spatial2d(cameras=["CAM_FRONT", "CAM_BACK"], projection=True)
74+
.with_spatial2d(cameras=["CAM_FRONT", "CAM_BACK"])
7575
.with_labels({"car": 1, "pedestrian": 2})
7676
.build("foo")
7777
)

t4_devkit/helper/rendering.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ def _init_viewer(
7070
sensor.channel for sensor in self._t4.sensor if sensor.modality == SensorModality.CAMERA
7171
]
7272

73-
# project 3D boxes if there is no 2D annotation
74-
projection = len(self._t4.object_ann) == 0 and len(self._t4.surface_ann) == 0
75-
builder = (
76-
ViewerBuilder().with_spatial3d().with_spatial2d(cameras=cameras, projection=projection)
77-
)
73+
builder = ViewerBuilder().with_spatial3d().with_spatial2d(cameras=cameras)
7874

7975
if render_ann:
8076
builder = builder.with_labels(self._label2id)

t4_devkit/viewer/builder.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,10 @@ def with_spatial3d(self) -> Self:
3636
self._config.spatial3ds.append(rrb.Spatial3DView(name="3D", origin=ViewerConfig.map_entity))
3737
return self
3838

39-
def with_spatial2d(self, cameras: Sequence[str], *, projection: bool = False) -> Self:
40-
overrides = {} # TODO(ktro2828): add support of projecting 3D elements on image
39+
def with_spatial2d(self, cameras: Sequence[str]) -> Self:
4140
self._config.spatial2ds.extend(
4241
[
43-
rrb.Spatial2DView(
44-
name=name,
45-
origin=format_entity(ViewerConfig.ego_entity, name),
46-
overrides=overrides,
47-
)
42+
rrb.Spatial2DView(name=name, origin=format_entity(ViewerConfig.ego_entity, name))
4843
for name in cameras
4944
]
5045
)

0 commit comments

Comments
 (0)