vis4d.vis.pointcloud

Pointcloud Visualization Package.

class PointCloudVisualizer(*args, backend='open3d', class_color_mapping=[(0, 114, 178), (121, 178, 0), (142, 178, 0), (164, 0, 178), (178, 42, 0), (0, 135, 178), (99, 0, 178), (0, 49, 178), (0, 178, 114), (178, 85, 0), (0, 7, 178), (35, 0, 178), (0, 157, 178), (14, 0, 178), (0, 178, 28), (178, 149, 0), (57, 178, 0), (178, 0, 107), (178, 0, 42), (0, 92, 178), (35, 178, 0), (0, 71, 178), (0, 28, 178), (14, 178, 0), (178, 0, 171), (0, 178, 71), (178, 0, 149), (178, 171, 0), (78, 178, 0), (0, 178, 178), (178, 107, 0), (0, 178, 7), (142, 0, 178), (178, 0, 21), (178, 21, 0), (99, 178, 0), (78, 0, 178), (0, 178, 157), (178, 128, 0), (0, 178, 135), (57, 0, 178), (0, 178, 92), (0, 178, 49), (164, 178, 0), (121, 0, 178), (178, 0, 85), (178, 64, 0), (178, 0, 0), (178, 0, 64), (178, 0, 128)], instance_color_mapping=[(0, 114, 178), (121, 178, 0), (142, 178, 0), (164, 0, 178), (178, 42, 0), (0, 135, 178), (99, 0, 178), (0, 49, 178), (0, 178, 114), (178, 85, 0), (0, 7, 178), (35, 0, 178), (0, 157, 178), (14, 0, 178), (0, 178, 28), (178, 149, 0), (57, 178, 0), (178, 0, 107), (178, 0, 42), (0, 92, 178), (35, 178, 0), (0, 71, 178), (0, 28, 178), (14, 178, 0), (178, 0, 171), (0, 178, 71), (178, 0, 149), (178, 171, 0), (78, 178, 0), (0, 178, 178), (178, 107, 0), (0, 178, 7), (142, 0, 178), (178, 0, 21), (178, 21, 0), (99, 178, 0), (78, 0, 178), (0, 178, 157), (178, 128, 0), (0, 178, 135), (57, 0, 178), (0, 178, 92), (0, 178, 49), (164, 178, 0), (121, 0, 178), (178, 0, 85), (178, 64, 0), (178, 0, 0), (178, 0, 64), (178, 0, 128)], **kwargs)[source]

Visualizer that visualizes pointclouds.

Creates a new Pointcloud visualizer.

Parameters:
  • backend (str) – Visualization backend that should be used. Choice of [open3d].

  • class_color_mapping (list[tuple[int, int, int]], optional) – List of length n_classes that assigns each class a unique color.

  • instance_color_mapping (list[tuple[int, int, int]], optional) – List of length n_classes that assigns each class a unique color.

process(cur_iter, points_xyz, semantics=None, instances=None, colors=None, scene_index=None)[source]

Processes a batch of data and adds it to the visualizer.

Parameters:
  • cur_iter (int) – Current iteration.

  • points_xyz (ndarray[Any, dtype[float64]]) – xyz coordinates of the points shape [N, 3]

  • semantics (Optional[ndarray[Any, dtype[int64]]]) – semantic ids of the points shape [N, 1]

  • instances (Optional[ndarray[Any, dtype[int64]]]) – instance ids of the points shape [N, 1]

  • colors (Optional[ndarray[Any, dtype[float64]]]) – colors of the points shape [N,3] and ranging from [0,1]

  • scene_index (Optional[ndarray[Any, dtype[int64]]]) – Scene index for visualization of sape [1] or int. This allows to plot multiple predictions in the same scene if e.g. for memory reasons it had to be split up in multiple chunls.

Raises:

ValueError – If shapes of the arrays missmatch.

Return type:

None

process_single(points_xyz, semantics=None, instances=None, colors=None, scene_index=None)[source]

Processes data and adds it to the visualizer.

Parameters:
  • points_xyz (ndarray[Any, dtype[float64]]) – xyz coordinates of the points shape [B, N, 3]

  • semantics (Optional[ndarray[Any, dtype[int64]]]) – semantic ids of the points shape [B, N, 1]

  • instances (Optional[ndarray[Any, dtype[int64]]]) – instance ids of the points shape [B, N, 1]

  • colors (Optional[ndarray[Any, dtype[float64]]]) – colors of the points shape [B, N,3] and ranging from [0,1]

  • scene_index (Union[ndarray[Any, dtype[int64]], int, None]) – Scene index for visualization of shape [B, 1]. This allows to plot multiple predictions in the same scene if e.g. for memory reasons it had to be split up in multiple channels..

Raises:

ValueError – If shapes of the arrays missmatch.

Return type:

None

reset()[source]

Clears all saved data.

Return type:

None

save_to_disk(cur_iter, output_folder)[source]

Saves the visualization to disk.

Return type:

None

show(cur_iter, blocking=True)[source]

Shows the visualization.

Parameters:
  • cur_iter (int) – Current iteration.

  • blocking (bool) – If the visualization should be blocking and wait for human input

Return type:

None

Modules

vis4d.vis.pointcloud.pointcloud_visualizer

Vis4D Visualization tools for analysis and debugging.

vis4d.vis.pointcloud.scene

Data structures to store 3D data.

vis4d.vis.pointcloud.viewer

Viewer implementations to display pointcloud.