Hyperspectral Image Segmentation#
Authors: Lars Doorenbos (NVIDIA)
Supported platforms: x86_64, aarch64
Language: Python
Last modified: September 23, 2026
Latest version: 1.0
Minimum Holoscan SDK version: 0.6.0
Tested Holoscan SDK versions: 0.6.0
Contribution metric: Level 2 - Trusted

This application segments endoscopic hyperspectral cubes into 20 organ classes. It visualizes the result together with the RGB image corresponding to the cube.
Data and Models#
The data is a subset of the HeiPorSPECTRAL dataset. The application loops over the 84 cubes selected. The model is the 2022-02-03_22-58-44_generated_default_model_comparison checkpoint from this repository, converted to ONNX with the script in utils/convert_to_onnx.py.
📦️ (NGC) App Data and Model for Hyperspectral Segmentation. This resource is automatically downloaded when building the application.
The Blosc reader supports the existing dataset's numeric array headers. It rejects
metadata that requires arbitrary Python objects and checks the decompressed size
against the array shape and dtype before constructing an array.
Shape dimensions and named-array lengths must be built-in Python integers, as in
the upstream writer's array.shape and len(compressed_data) values. Custom
writers should normalize dimensions with tuple(int(size) for size in shape)
before serializing them; NumPy scalar metadata is not supported.
Run Instructions#
This application requires some python modules to be installed. You can simply use Holohub CLI to build and run the application.
./holohub run hyperspectral_segmentation
This single command builds and runs a Docker container, then inside that container, it builds and runs the application.
To build and run the container without building the application, you can use the following command:
./holohub run-container hyperspectral_segmentation
Tests#
./holohub test hyperspectral_segmentation runs the input regression suite and
the existing application smoke test through CTest. To run only the input tests
without downloading the dataset or model:
./holohub test hyperspectral_segmentation \
--cmake-options="-DHOLOHUB_DOWNLOAD_DATASETS=OFF" \
--ctest-options="-DCTEST_TEST_INCLUDE=^hyperspectral_segmentation_input_test$"
Viewing Results#
With the default settings, the results of this application are saved to result.png file in the hyperspectral segmentation app directory. Each time a new image is processed, it overwrites result.png. By opening this image while the application is running, you can see the results as the updates are made (may depend on your image viewer).