PyVista visualization
Minimal example of interactive visualization using pyvista and the synthetic test data¶
Note: for exporting to mp4, install imageio with pip install imageio[ffmpeg]
Note: if the display remains blank (does not show loading screen), try restarting the kernel and rerunning
In [4]:
Copied!
import pyvista as pv
from occpy import OccPy
from occpy.visualization import vis_pv_static_bounds, vis_pv_rotating
import pyvista as pv
from occpy import OccPy
from occpy.visualization import vis_pv_static_bounds, vis_pv_rotating
In [5]:
Copied!
occpy_root = r"C:\Users\Kueken\dev\occpy_dev\OccPy"
grid = f"{occpy_root}/tests/fixtures/two_sensor_case/expected/Classification.npy"
min_bound = [2, 2, 0]
max_bound = [10, 10, 10]
config_file = f"{occpy_root}/tests/fixtures/two_sensor_case/case_config.json"
pc_file = f"{occpy_root}/tests/fixtures/two_sensor_case/input/laz/001_synthetic.laz"
occpy_root = r"C:\Users\Kueken\dev\occpy_dev\OccPy"
grid = f"{occpy_root}/tests/fixtures/two_sensor_case/expected/Classification.npy"
min_bound = [2, 2, 0]
max_bound = [10, 10, 10]
config_file = f"{occpy_root}/tests/fixtures/two_sensor_case/case_config.json"
pc_file = f"{occpy_root}/tests/fixtures/two_sensor_case/input/laz/001_synthetic.laz"
In [6]:
Copied!
plotter = vis_pv_static_bounds(grid, min_bound, max_bound, config_file, pc_file, point_size=5)
plotter = vis_pv_static_bounds(grid, min_bound, max_bound, config_file, pc_file, point_size=5)
Occlusion map dimensions: (20, 20, 20) Crop bounds: [2. 2. 0.] to [10. 10. 10.]
In [7]:
Copied!
pv.set_jupyter_backend('trame')
plotter.show()
pv.set_jupyter_backend('trame')
plotter.show()
Widget(value='<iframe src="http://localhost:54395/index.html?ui=P_0x21517d97d90_0&reconnect=auto" class="pyvis…
In [8]:
Copied!
vis_pv_rotating(grid, min_bound, max_bound, config_file, opath="demo.mp4", pointcloud_file=pc_file, point_size=10)
vis_pv_rotating(grid, min_bound, max_bound, config_file, opath="demo.mp4", pointcloud_file=pc_file, point_size=10)
Crop bounds: [2. 2. 0.] to [10. 10. 10.]