From 88afa6bc3aa701f9e69047021274a984cf951289 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Tue, 30 Jul 2024 19:16:15 +0200 Subject: [PATCH 1/2] solid boxes for nuscenes --- .../nuscenes_dataset/__main__.py | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/examples/python/nuscenes_dataset/nuscenes_dataset/__main__.py b/examples/python/nuscenes_dataset/nuscenes_dataset/__main__.py index ea0befd92c61..42f0a5e4637a 100755 --- a/examples/python/nuscenes_dataset/nuscenes_dataset/__main__.py +++ b/examples/python/nuscenes_dataset/nuscenes_dataset/__main__.py @@ -174,7 +174,10 @@ def log_radars(first_radar_tokens: list[str], nusc: nuscenes.NuScenes, max_times points = pointcloud.points[:3].T # shape after transposing: (num_points, 3) point_distances = np.linalg.norm(points, axis=1) point_colors = cmap(norm(point_distances)) - rr.log(f"world/ego_vehicle/{sensor_name}", rr.Points3D(points, colors=point_colors)) + rr.log( + f"world/ego_vehicle/{sensor_name}", + rr.Points3D(points, colors=point_colors), + ) current_camera_token = sample_data["next"] @@ -204,7 +207,16 @@ def log_annotations(first_sample_token: str, nusc: nuscenes.NuScenes, max_timest label2id[ann["category_name"]] = len(label2id) class_ids.append(label2id[ann["category_name"]]) - rr.log("world/anns", rr.Boxes3D(sizes=sizes, centers=centers, rotations=rotations, class_ids=class_ids)) + rr.log( + "world/anns", + rr.Boxes3D( + sizes=sizes, + centers=centers, + rotations=rotations, + class_ids=class_ids, + fill_mode=rr.components.FillMode.Solid, + ), + ) current_sample_token = sample_data["next"] # skipping for now since labels take too much space in 3D view (see https://github.com/rerun-io/rerun/issues/4451) @@ -255,7 +267,10 @@ def main() -> None: ) parser.add_argument("--dataset-version", type=str, default="v1.0-mini", help="Scene id to visualize") parser.add_argument( - "--seconds", type=float, default=float("inf"), help="If specified, limits the number of seconds logged" + "--seconds", + type=float, + default=float("inf"), + help="If specified, limits the number of seconds logged", ) rr.script_add_args(parser) args = parser.parse_args() @@ -291,7 +306,11 @@ def main() -> None: rr.script_setup(args, "rerun_example_nuscenes", default_blueprint=blueprint) - rr.log("description", rr.TextDocument(DESCRIPTION, media_type=rr.MediaType.MARKDOWN), timeless=True) + rr.log( + "description", + rr.TextDocument(DESCRIPTION, media_type=rr.MediaType.MARKDOWN), + timeless=True, + ) log_nuscenes(nusc, args.scene_name, max_time_sec=args.seconds) From 253dd6973c99310f41c7a43e418d9138bcca9eea Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Wed, 31 Jul 2024 15:31:20 +0200 Subject: [PATCH 2/2] readme too --- examples/python/nuscenes_dataset/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/python/nuscenes_dataset/README.md b/examples/python/nuscenes_dataset/README.md index 0cc297cd861d..943a9ae7bed9 100644 --- a/examples/python/nuscenes_dataset/README.md +++ b/examples/python/nuscenes_dataset/README.md @@ -105,7 +105,16 @@ rr.log(f"world/ego_vehicle/{sensor_name}", rr.Points3D(points, colors=point_colo Annotations are logged as [`Boxes3D`](https://www.rerun.io/docs/reference/types/archetypes/boxes3d), containing details such as object positions, sizes, and rotation. ```python -rr.log("world/anns", rr.Boxes3D(sizes=sizes, centers=centers, rotations=rotations, class_ids=class_ids)) +rr.log( + "world/anns", + rr.Boxes3D( + sizes=sizes, + centers=centers, + rotations=rotations, + class_ids=class_ids, + fill_mode=rr.components.FillMode.Solid, + ), +) ``` ### Setting up the default blueprint