viewer
ViewerBuilder
Builder for creating a RerunViewer instance.
Examples:
>>> from t4_devkit.viewer import ViewerBuilder
>>> viewer = (
ViewerBuilder()
.with_spatial3d()
.with_spatial2d(cameras=["CAM_FRONT", "CAM_BACK"])
.with_labels(label2id={"car": 1, "pedestrian": 2})
.with_streetmap(latlon=[48.8566, 2.3522])
.build(app_id="my_viewer")
)
RerunViewer
A viewer class that renders some components powered by rerun.
Construct a new object.
Parameters:
-
app_id
str
) –Application ID.
-
config
ViewerConfig
, default:ViewerConfig()
) –Configuration of the viewer.
-
save_dir
str | None
, default:None
) –Directory path to save the recording. Viewer will be spawned if it is None, otherwise not.
Examples:
>>> from t4_devkit.viewer import ViewerBuilder
>>> viewer = (
ViewerBuilder()
.with_spatial3d()
.with_spatial2d(cameras=["CAM_FRONT", "CAM_BACK"])
.with_labels(label2id={"car": 1, "pedestrian": 2})
.with_streetmap(latlon=[48.8566, 2.3522])
.build(app_id="my_viewer")
)
render_box3ds
render_box3ds(
seconds: float,
frame_id: str,
centers: Sequence[Vector3Like],
rotations: Sequence[RotationLike],
sizes: Sequence[Vector3Like],
class_ids: Sequence[int],
velocities: Sequence[Vector3Like] | None = None,
uuids: Sequence[str] | None = None,
futures: Sequence[Future] | None = None,
) -> None
Render 3D boxes.
render_box2ds
Render 2D boxes.
render_segmentation2d
render_segmentation2d(
seconds: float,
camera: str,
masks: Sequence[NDArrayU8],
class_ids: Sequence[int],
uuids: Sequence[str | None] | None = None,
) -> None
Render 2D segmentation image.
Parameters:
-
seconds
float
) –Timestamp in [sec].
-
camera
str
) –Name of camera channel.
-
masks
Sequence[NDArrayU8]
) –Sequence of segmentation mask of each instance, each mask is the shape of (W, H).
-
class_ids
Sequence[int]
) –Sequence of label ids.
-
uuids
Sequence[str | None] | None
, default:None
) –Sequence of each instance ID.
render_pointcloud
render_pointcloud(
seconds: float,
channel: str,
pointcloud: PointCloudLike,
color_mode: PointCloudColorMode = PointCloudColorMode.DISTANCE,
) -> None
Render pointcloud.
Parameters:
-
seconds
float
) –Timestamp in [sec].
-
channel
str
) –Name of the pointcloud sensor channel.
-
pointcloud
PointCloudLike
) –Inherence object of
PointCloud
. -
color_mode
PointCloudColorMode
, default:DISTANCE
) –Color mode for pointcloud.
render_image
render_ego
Render an ego pose.
render_calibration
Render a sensor calibration.
render_map
ViewerConfig
pointcloud_color
pointcloud_color(
pointcloud: PointCloudLike,
color_mode: PointCloudColorMode = PointCloudColorMode.DISTANCE,
) -> NDArrayF64
Return color map depending on the specified color mode.
Parameters:
-
pointcloud
PointCloudLike
) –Any inheritance of
PointCloud
class. -
color_mode
PointCloudColorMode
, default:DISTANCE
) –Color mode for pointcloud.
calculate_geodetic_point
Transform a position in a map coordinate system to a position in a geodetic coordinate system.
Parameters:
-
position
Vector3Like
) –3D position in a map coordinate system.
-
origin
Vector2Like
) –Map origin position in a geodetic coordinate system, which is (latitude, longitude).
Returns:
-
Vector2
–Transformed position in a geodetic coordinate system, which is (latitude, longitude).