open3d.ml.torch.vis.Visualizer¶
-
class
open3d.ml.torch.vis.
Visualizer
¶ The visualizer class for dataset objects and custom point clouds.
-
class
ColormapEdit
(window, em)¶ This class is used to create a color map for visualization of points.
-
__init__
(window, em)¶ Initialize self. See help(type(self)) for accurate signature.
-
set_on_changed
(callback)¶
-
update
(colormap, min_val, max_val)¶ Updates the colormap based on the minimum and maximum values passed.
-
-
class
LabelLUTEdit
¶ This class includes functionality for managing a labellut (label look-up-table).
-
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
-
clear
()¶ Clears the look-up table.
-
get_colors
()¶ Returns a list of label keys.
-
is_empty
()¶ Checks if the look-up table is empty.
-
set_labels
(labellut)¶ Updates the labels based on look-up table passsed.
-
set_on_changed
(callback)¶
-
-
class
ProgressDialog
(title, window, n_items)¶ This class is used to manage the progress dialog displayed during visualization.
- Parameters
title – The title of the dialog box.
window – The window where the progress dialog box should be displayed.
n_items – The maximum number of items.
-
__init__
(title, window, n_items)¶ Initialize self. See help(type(self)) for accurate signature.
-
post_update
(text=None)¶ Post updates to the main thread.
-
set_text
(text)¶ Set the label text on the dialog box.
-
update
()¶ Enumerate the progress in the dialog box.
-
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
-
set_lut
(attr_name, lut)¶ Set the LUT for a specific attribute.
Args: attr_name: The attribute name as string. lut: The LabelLUT object that should be updated.
-
setup_camera
()¶ Set up camera for visualization.
-
show_geometries_under
(name, show)¶ Show geometry for a given node.
-
visualize
(data, lut=None, bounding_boxes=None, width=1280, height=768)¶ Visualize a 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.
lut – Optional lookup table for colors.
bounding_boxes – Optional bounding boxes.
width – window width.
height – window height.
-
visualize_dataset
(dataset, split, indices=None, width=1280, height=768)¶ Visualize 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 – The dataset to use for visualization.
split – The dataset split to be used, such as ‘training’
indices – An iterable with a subset of the data points to visualize, such as [0,2,3,4].
width – The width of the visualization window.
height – The height of the visualization window.
-
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'¶
-
class