Skip to content

Commit 5a70316

Browse files
Add pipeline visualization example.
This example demonstrates real-time visualization of data from Holoscan applications using NATS messaging and web-based dashboards. It showcases how to stream tensor data from a Holoscan pipeline and visualize it dynamically in a browser. Signed-off-by: Andreas Heumann <[email protected]>
1 parent 9c10dac commit 5a70316

31 files changed

+3682
-0
lines changed

.vscode/launch.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,45 @@
12621262
},
12631263
//#endregion nvidia_nim_nvclip
12641264

1265+
//#region pipeline_visualization
1266+
{
1267+
"name": "(gdb) pipeline_visualization/cpp",
1268+
"type": "cppdbg",
1269+
"request": "launch",
1270+
"preLaunchTask": "Build pipeline_visualization",
1271+
"program": "${workspaceFolder}/build/pipeline_visualization/applications/pipeline_visualization/cpp/pipeline_visualization",
1272+
"args": [ ],
1273+
"stopAtEntry": false,
1274+
"cwd": "${workspaceFolder}/applications/pipeline_visualization/",
1275+
"externalConsole": false,
1276+
"MIMode": "gdb",
1277+
"setupCommands": [
1278+
{
1279+
"description": "Enable pretty-printing for gdb",
1280+
"text": "-enable-pretty-printing",
1281+
"ignoreFailures": true
1282+
}
1283+
],
1284+
"presentation": {
1285+
"group": "pipeline_visualization",
1286+
}
1287+
},
1288+
{
1289+
"name": "(debugpy) pipeline_visualization/python",
1290+
"type": "debugpy",
1291+
"request": "launch",
1292+
"preLaunchTask": "Build pipeline_visualization",
1293+
"program": "${workspaceFolder}/applications/pipeline_visualization/python/pipeline_visualization.py",
1294+
"cwd": "${workspaceFolder}/build/pipeline_visualization/",
1295+
"env": {
1296+
"PYTHONPATH": "${workspaceFolder}/build/pipeline_visualization/python/lib:${workspaceFolder}:${env:PYTHONPATH}"
1297+
},
1298+
"presentation": {
1299+
"group": "pipeline_visualization",
1300+
}
1301+
},
1302+
//#endregion pipeline_visualization
1303+
12651304
//#region slang
12661305
{
12671306
"name": "(gdb) slang_simple/cpp",

.vscode/tasks.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,26 @@
515515
"problemMatcher": [],
516516
"detail": "CMake template build task"
517517
},
518+
{
519+
"type": "shell",
520+
"label": "Build pipeline_visualization",
521+
"command": "./holohub",
522+
"args": [
523+
"build",
524+
"pipeline_visualization",
525+
"--build-type",
526+
"debug",
527+
"--local",
528+
"--language",
529+
"python"
530+
],
531+
"options": {
532+
"cwd": "${env:WORKSPACE_DIR}"
533+
},
534+
"group": "build",
535+
"problemMatcher": [],
536+
"detail": "CMake template build task"
537+
},
518538
{
519539
"type": "shell",
520540
"label": "Build slang_simple",

applications/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ add_holohub_application(object_detection_torch DEPENDS
9292

9393
add_holohub_application(openigtlink_3dslicer DEPENDS OPERATORS openigtlink)
9494

95+
add_holohub_application(pipeline_visualization)
96+
9597
add_holohub_application(polyp_detection)
9698

9799
add_holohub_application(pva_video_filter)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
cmake_minimum_required(VERSION 3.20)
17+
18+
include(FetchContent)
19+
20+
cmake_minimum_required(VERSION 3.20)
21+
22+
find_package(holoscan 3.8.0 REQUIRED CONFIG
23+
PATHS "/opt/nvidia/holoscan" "/workspace/holoscan-sdk/install")
24+
25+
FetchContent_Declare(
26+
flatbuffers
27+
GIT_REPOSITORY https://github.com/google/flatbuffers.git
28+
GIT_TAG v25.9.23
29+
CMAKE_ARGS
30+
-DFLATBUFFERS_BUILD_TESTS=OFF
31+
-DFLATBUFFERS_BUILD_FLATHASH=OFF
32+
-DFLATBUFFERS_BUILD_FLATC=ON
33+
-DFLATBUFFERS_BUILD_FLATLIB=ON
34+
-DFLATBUFFERS_STATIC_FLATC=ON
35+
-DFLATBUFFERS_STRICT_MODE=ON
36+
)
37+
FetchContent_MakeAvailable(flatbuffers)
38+
list(APPEND CMAKE_MODULE_PATH "${flatbuffers_SOURCE_DIR}/CMake")
39+
40+
include(BuildFlatBuffers)
41+
42+
set(FB_SCHEMA_FILES
43+
"${CMAKE_CURRENT_SOURCE_DIR}/schemas/message.fbs"
44+
"${CMAKE_CURRENT_SOURCE_DIR}/schemas/tensor.fbs"
45+
)
46+
47+
# Build for cpp and python
48+
set(FLATBUFFERS_FLATC_SCHEMA_EXTRA_ARGS
49+
--cpp
50+
--python
51+
--bfbs-gen-embed
52+
--cpp-ptr-type std::shared_ptr
53+
--gen-object-api
54+
--reflect-names
55+
--reflect-types
56+
--schema
57+
)
58+
59+
build_flatbuffers(
60+
"${FB_SCHEMA_FILES}" # flatbuffers_schemas
61+
"" # flatbuffers_options
62+
"pipeline_visualization_flatbuffers_schemas" # flatbuffers_target_name
63+
"" # additional_dependencies
64+
"${CMAKE_CURRENT_BINARY_DIR}/flatbuffers" # generated_includes_dir
65+
"" # binary_schemas_dir
66+
"" # copy_text_schemas_dir
67+
)
68+
69+
add_library(pipeline_visualization_flatbuffers_target INTERFACE)
70+
add_library(pipeline_visualization_flatbuffers::target ALIAS pipeline_visualization_flatbuffers_target)
71+
target_include_directories(pipeline_visualization_flatbuffers_target
72+
INTERFACE
73+
${CMAKE_CURRENT_BINARY_DIR}
74+
${flatbuffers_SOURCE_DIR}/include
75+
)
76+
add_dependencies(pipeline_visualization_flatbuffers_target
77+
pipeline_visualization_flatbuffers_schemas
78+
)
79+
80+
add_subdirectory(cpp)
81+
if(HOLOHUB_BUILD_PYTHON)
82+
add_subdirectory(python)
83+
endif()

0 commit comments

Comments
 (0)