Includes multiple examples showing how to use various features of the Holoviz operator
- use the camera with 3d primitives
- use the geometry layer and the image layer
- use the geometry layer with 3d primitives
- use [layer views][#holovizop-views-usage]
Visit the SDK User Guide to learn more about Visualization in Holoscan.
This application demonstrates how to render 3d primitives and view the geometry from different camera positions and also how to retrieve the current camera position from the Holoviz operator.
The GeometrySourceOp generates a 3D cube, each side is output as a separate tensor. It also randomly switches between camera positions each second.
The HolovizOp renders the 3d primitives, smoothly interpolates between camera positions, allows to use the mouse to change the camera and outputs the current camera position for CameraPoseRxOp.
The CameraPoseRxOp receives camera pose information and prints to the console (but only once every second).
- using deb package install or NGC container:
/opt/nvidia/holoscan/examples/holoviz/cpp/holoviz_camera
- source (dev container):
./run launch # optional: append `install` for install tree ./examples/holoviz/cpp/holoviz_camera - source (local env):
${BUILD_OR_INSTALL_DIR}/examples/holoviz/cpp/holoviz_camera
As for example/tensor_interop/python/tensor_interop.py, this application demonstrates interoperability between a native operator (ImageProcessingOp) and two operators (VideoStreamReplayerOp and HolovizOp) that wrap existing C++-based operators. This application also demonstrates two additional aspects:
- capability to add multiple tensors to the message sent on the output port of a native operator (
ImageProcessingOp) - expected tensor shapes and arguments needed for HolovizOp in order to display overlays of various geometric primitives onto an underlying color video.
The following dataset is used by this example: 📦️ (NGC) Sample RacerX Video Data.
- using deb package install or NGC container:
/opt/nvidia/holoscan/examples/holoviz/cpp/holoviz_geometry
- source (dev container):
./run launch # optional: append `install` for install tree ./examples/holoviz/cpp/holoviz_geometry - source (local env):
${BUILD_OR_INSTALL_DIR}/examples/holoviz/cpp/holoviz_geometry
- using python wheel:
# [Prerequisite] Download NGC dataset above to `DATA_DIR` export HOLOSCAN_INPUT_PATH=<DATA_DIR> # [Prerequisite] Download example .py file below to `APP_DIR` # [Optional] Start the virtualenv where holoscan is installed python3 -m pip install "numpy<2.0" python3 <APP_DIR>/holoviz_geometry.py
- from NGC container:
python3 /opt/nvidia/holoscan/examples/holoviz/python/holoviz_geometry.py
- source (dev container):
./run launch # optional: append `install` for install tree python3 ./examples/holoviz/python/holoviz_geometry.py - source (local env):
python3 -m pip install "numpy<2.0" export PYTHONPATH=${BUILD_OR_INSTALL_DIR}/python/lib export HOLOSCAN_INPUT_PATH=${SRC_DIR}/data python3 ${BUILD_OR_INSTALL_DIR}/examples/holoviz/python/holoviz_geometry.py
As for example/tensor_interop/python/tensor_interop.py, this application demonstrates interoperability between a native operator (Geometry3dOp) and an operator (HolovizOp) that wraps an existing C++-based operator. This application also demonstrates two additional aspects:
- capability to add multiple tensors to the message sent on the output port of a native operator (
Geometry3dOp) - expected tensor shapes and arguments needed for HolovizOp in order to display overlays of various geometric primitives.
- using python wheel:
# [Prerequisite] Download example .py file below to `APP_DIR` # [Optional] Start the virtualenv where holoscan is installed python3 -m pip install "numpy<2.0" python3 <APP_DIR>/holoviz_geometry_3d.py
- from NGC container:
python3 /opt/nvidia/holoscan/examples/holoviz/python/holoviz_geometry_3d.py
- source (dev container):
./run launch # optional: append `install` for install tree python3 ./examples/holoviz/python/holoviz_geometry_3d.py - source (local env):
python3 -m pip install "numpy<2.0" export PYTHONPATH=${BUILD_OR_INSTALL_DIR}/python/lib python3 ${BUILD_OR_INSTALL_DIR}/examples/holoviz/python/holoviz_geometry_3d.py
This example demonstrates how to use views on layers. A layer can be an image or geometry. A view defines how a layer is placed in the output window. A view
defines the 2D offset and size of a layer and also can be placed in 3d space using a 3d transformation matrix. More information can be found here.
The VideoStreamReplayerOp reads video frames from a file and passes them to the ImageViewsOp.
The ImageViewsOp takes the frames, defines multiple dynamic and static views and passes the video frames to the HolovizOp. The ImageViewsOp also generates
the view and data for a rotating frame counter.
The HolovizOp renders the video frame views and the frame counter.
The following dataset is used by this example: 📦️ (NGC) Sample RacerX Video Data.
- using python wheel:
# [Prerequisite] Download NGC dataset above to `DATA_DIR` export HOLOSCAN_INPUT_PATH=<DATA_DIR> # [Prerequisite] Download example .py file below to `APP_DIR` # [Optional] Start the virtualenv where holoscan is installed python3 -m pip install "numpy<2.0" python3 <APP_DIR>/holoviz_views.py
- from NGC container:
python3 /opt/nvidia/holoscan/examples/holoviz/python/holoviz_views.py
- source (dev container):
./run launch # optional: append `install` for install tree python3 ./examples/holoviz/python/holoviz_views.py - source (local env):
python3 -m pip install "numpy<2.0" export PYTHONPATH=${BUILD_OR_INSTALL_DIR}/python/lib export HOLOSCAN_INPUT_PATH=${SRC_DIR}/data python3 ${BUILD_OR_INSTALL_DIR}/examples/holoviz/python/holoviz_views.py