Skip to content

Commit 758b6f2

Browse files
Make sure the static visualizer is working with the Python app.
Update the README and mention that Python dependencies need to be installed before launching the visualizer. Signed-off-by: Andreas Heumann <[email protected]>
1 parent cfbb776 commit 758b6f2

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

applications/pipeline_visualization/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This will start a NATS server listening on `0.0.0.0:4222`.
3333

3434
### Step 3: Start the Visualizer
3535

36-
In a second terminal, start one of the Python visualizers:
36+
In a second terminal, make sure the [visualizer Python dependencies](#visualizer-python-dependencies) are installed and start one of the Python visualizers:
3737

3838
```bash
3939
cd applications/pipeline_visualization/visualizer
@@ -44,7 +44,7 @@ The web interface will be available at: **[http://localhost:8050](http://localho
4444

4545
### Step 4: Run the Holoscan Application
4646

47-
In a third terminal, run the C++ application:
47+
In a third terminal, run the application:
4848

4949
```bash
5050
# Run the Python version (default when --language is not specified)
@@ -137,18 +137,18 @@ flowchart TB
137137

138138
## Components
139139

140-
### C++ Application (`cpp/`)
140+
### Application (`cpp/` and `python/`)
141141

142-
The C++ application demonstrates a simple Holoscan pipeline with data logging:
142+
The C++ and Python applications demonstrates a simple Holoscan pipeline with data logging:
143143

144144
- **SourceOp**: Generates sine waves with varying frequencies (10-20 Hz)
145145
- **ModulateOp**: Adds high-frequency modulation (300 Hz) to the signal
146146
- **SinkOp**: Receives the processed data
147147
- **NatsLogger**: A custom data logger that publishes tensor data to NATS using FlatBuffers serialization
148148

149-
The application logs both inputs and outputs of operators, allowing visualization of data at each stage of the pipeline.
149+
The applications log both inputs and outputs of operators, allowing visualization of data at each stage of the pipeline.
150150

151-
### Python Visualizers (`python/`)
151+
### Python Visualizers (`visualizer/`)
152152

153153
Two visualization options are provided:
154154

@@ -185,9 +185,11 @@ The data format is defined using FlatBuffers for efficient serialization:
185185

186186
## Prerequisites
187187

188-
All dependencies are installed automatically when using the `holohub run` command inside the Holohub container.
188+
All dependencies to run the application are installed automatically when using the `holohub run` command inside
189+
the Holohub container. Since the visualizer is run outside the Holohub container, its dependencies must be
190+
installed separately. See the next section for details.
189191

190-
### Python Dependencies
192+
### Visualizer Python Dependencies
191193

192194
Install the required Python packages:
193195

applications/pipeline_visualization/visualizer/visualizer_static.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,13 @@ def update_source(n_intervals, subject): # noqa: ARG001
137137

138138
# Identify which graph this data belongs to
139139
unique_id = message.UniqueId().decode()
140-
try:
141-
index = self._unique_ids.index(unique_id)
142-
except ValueError:
140+
for i, id in enumerate(self._unique_ids):
141+
# the python application is using tensor maps where the unique_id also contains
142+
# the tensor name, so we need to check if the unique_id starts with the id
143+
if unique_id.startswith(id):
144+
index = i
145+
break
146+
else:
143147
logger.warning(f"Unknown unique_id: {unique_id}")
144148
continue
145149

0 commit comments

Comments
 (0)