Skip to content

Commit

Permalink
solid boxes for nuscenes
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jul 30, 2024
1 parent ff26b3a commit 88afa6b
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions examples/python/nuscenes_dataset/nuscenes_dataset/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 88afa6b

Please sign in to comment.