def _start_gui(self): webrtc_server.disable_http_handshake() webrtc_server.enable_webrtc() from open3d.visualization.async_event_loop import async_event_loop self._gui = async_event_loop # Dummy window to ensure GUI remains active even if all user windows are # closed. self._dummy_window = self._gui.run_sync( gui.Application.instance.create_window, "Open3D Dummy Window", 32, 32) webrtc_server.register_data_channel_message_callback( "tensorboard/show_hide_axes", self._show_hide) webrtc_server.register_data_channel_message_callback( "tensorboard/show_hide_ground", self._show_hide) webrtc_server.register_data_channel_message_callback( "tensorboard/sync_view", self._sync_view) webrtc_server.register_data_channel_message_callback( "tensorboard/update_rendering", self._update_rendering)
import numpy as np from tensorboard.plugins import base_plugin import werkzeug from werkzeug import wrappers if sys.platform == 'darwin': raise NotImplementedError("Open3D for TensorBoard does not run on macOS.") import open3d as o3d # TODO: Check for GPU / EGL else TensorBoard will crash. from open3d.visualization import O3DVisualizer from open3d.visualization import gui from open3d.visualization import rendering from open3d.visualization import webrtc_server from open3d.visualization.tensorboard_plugin import plugin_data_pb2 # Set window system before the GUI event loop webrtc_server.enable_webrtc() from open3d.visualization.async_event_loop import async_event_loop from open3d.visualization.tensorboard_plugin import metadata from open3d.visualization.tensorboard_plugin.util import Open3DPluginDataReader from open3d.visualization.tensorboard_plugin.util import _log def _postprocess(geometry): """Post process geometry before displaying to account for WIP Tensor API in Open3D. """ if isinstance(geometry, o3d.t.geometry.PointCloud): return geometry legacy = geometry.to_legacy() # color is FLoat64 but range is [0,255]!