open3d.ml.tf.vis.Visualizer

class open3d.ml.tf.vis.Visualizer

Visualizer for Dataset objects and custom point clouds

class ColormapEdit(window, em)
__init__(window, em)

Initialize self. See help(type(self)) for accurate signature.

set_on_changed(callback)
update(colormap, min_val, max_val)
class LabelLUTEdit
__init__()

Initialize self. See help(type(self)) for accurate signature.

clear()
get_colors()
is_empty()
set_labels(labellut)
set_on_changed(callback)
class ProgressDialog(title, window, n_items)
__init__(title, window, n_items)

Initialize self. See help(type(self)) for accurate signature.

post_update(text=None)
set_text(text)
update()
__init__()

Initialize self. See help(type(self)) for accurate signature.

set_lut(attr_name, lut)

Sets the LUT for a specific attribute

Parameters
  • attr_name – Attribute name as string.

  • lut – A LabelLUT object.

setup_camera()
show_geometries_under(name, show)
visualize(data, width=1024, height=768)

Visualizes custom point cloud data

Example

Minimal example for visualizing a single point cloud with an attribute:

import numpy as np
import open3d.ml.torch as ml3d
# or import open3d.ml.tf as ml3d

data = [ {
    'name': 'my_point_cloud',
    'points': np.random.rand(100,3).astype(np.float32),
    'point_attr1': np.random.rand(100).astype(np.float32),
    } ]

vis = ml3d.vis.Visualizer()
vis.visualize(data)
Parameters
  • data – A list of dictionaries. Each dictionary is a point cloud with attributes. Each dictionary must have the entries ‘name’ and ‘points’. Points and point attributes can be passed as numpy arrays, PyTorch tensors or TensorFlow tensors.

  • width – window width.

  • height – window height.

visualize_dataset(dataset, split, indices=None, width=1024, height=768)

Visualizes a dataset

Example

Minimal example for visualizing a dataset::

import open3d.ml.torch as ml3d # or open3d.ml.tf as ml3d

dataset = ml3d.datasets.SemanticKITTI(dataset_path=’/path/to/SemanticKITTI/’) vis = ml3d.vis.Visualizer() vis.visualize_dataset(dataset, ‘all’, indices=range(100))

Parameters
  • dataset – A dataset object.

  • split – A string that identifies the split, e.g., ‘test’.

  • indices – An iterable with a subset of the data points to visualize. E.g., [0,2,3,4].

  • width – window width.

  • height – window height.

COLOR_NAME = 'RGB'
GREYSCALE_NAME = 'Colormap (Greyscale)'
LABELS_NAME = 'Label Colormap'
RAINBOW_NAME = 'Colormap (Rainbow)'
SOLID_NAME = 'Solid Color'
X_ATTR_NAME = 'x position'
Y_ATTR_NAME = 'y position'
Z_ATTR_NAME = 'z position'