-
Notifications
You must be signed in to change notification settings - Fork 133
[Documentation] Nvidia style guide edits to pipeline visualization #1328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d83ae3d
mmiranda Nvidia style guide edits to pipeline vizualization
megnvidia 8769b75
Update applications/pipeline_visualization/README.md
megnvidia 7f41b67
Merge branch 'main' into mmiranda-pipeline-vizualization
bhashemian a7983f1
Fix link to heading
bhashemian a979406
Merge branch 'main' into mmiranda-pipeline-vizualization
bhashemian b919f72
Merge branch 'main' into mmiranda-pipeline-vizualization
bhashemian 4eecaf5
mmiranda making changes locally from AI and other comments on the PR
megnvidia b73c03a
Update applications/pipeline_visualization/README.md
megnvidia 55a0e41
Merge branch 'main' into mmiranda-pipeline-vizualization
bhashemian a0ea980
user list charachters uniformly
bhashemian b21706a
Merge branch 'main' into mmiranda-pipeline-vizualization
bhashemian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,9 +8,9 @@ This example demonstrates real-time visualization of data from Holoscan applicat | |||||
|
|
||||||
| The example consists of three main components: | ||||||
|
|
||||||
| 1. **C++ Data Producer**: A Holoscan application that generates data (sine waves) and publishes it to NATS | ||||||
| 2. **NATS Server**: A message broker that handles real-time data streaming | ||||||
| 3. **Python Web Visualizers**: Dash-based web applications that subscribe to NATS streams and display live plots | ||||||
| * **C++ Data Producer**: A Holoscan application that generates data (sine waves) and publishes it to NATS | ||||||
| * **NATS Server**: A message broker that handles real-time data streaming | ||||||
| * **Python Web Visualizers**: Dash-based web applications that subscribe to NATS streams and display live plots | ||||||
|
|
||||||
| ## Quick Start | ||||||
|
|
||||||
|
|
@@ -41,16 +41,20 @@ The web interface will be available at: [http://localhost:8050](http://localhost | |||||
|
|
||||||
| In a third terminal, run the application: | ||||||
|
|
||||||
| ```bash | ||||||
| # Run the Python version (default when --language is not specified) | ||||||
| ./holohub run pipeline_visualization | ||||||
| 1. Run the Python version (default when `--language` is not specified): | ||||||
|
|
||||||
| # Or explicitly specify the language: | ||||||
| ./holohub run pipeline_visualization --language python | ||||||
| ./holohub run pipeline_visualization --language cpp | ||||||
| ``` | ||||||
| ```bash | ||||||
| ./holohub run pipeline_visualization | ||||||
| ``` | ||||||
|
|
||||||
| 1. Or explicitly specify the language: | ||||||
|
|
||||||
| ```bash | ||||||
| ./holohub run pipeline_visualization --language python | ||||||
| ./holohub run pipeline_visualization --language cpp | ||||||
| ``` | ||||||
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| **Command-line Options:** | ||||||
| Command-line options for `pipeline_visualization`: | ||||||
|
|
||||||
| ```text | ||||||
| Usage: ./pipeline_visualization [options] | ||||||
|
|
@@ -63,18 +67,18 @@ Options: | |||||
| -r, --publish_rate Publish rate in Hz (default: 2.0) | ||||||
| ``` | ||||||
|
|
||||||
| **Example with custom settings:** | ||||||
| Example with custom settings: | ||||||
|
|
||||||
| ```bash | ||||||
| ./holohub run pipeline_visualization --nats_url nats://0.0.0.0:4222 --subject_prefix my_demo --publish_rate 5.0 | ||||||
| ``` | ||||||
|
|
||||||
| ### Step 4: Visualize the Data | ||||||
|
|
||||||
| 1. Open your web browser to [http://localhost:8050](http://localhost:8050) | ||||||
| 2. Enter the subject name (default: `nats_demo`) | ||||||
| 3. Click **Connect** | ||||||
| 4. Watch the real-time data plots update! | ||||||
| 1. Open your web browser to [http://localhost:8050](http://localhost:8050). | ||||||
| 2. Enter the subject name (default: `nats_demo`). | ||||||
| 3. Click **Connect**. | ||||||
| 4. Watch the real-time data plots update. | ||||||
|
|
||||||
| The visualizer will display: | ||||||
|
|
||||||
|
|
@@ -87,7 +91,7 @@ The visualizer will display: | |||||
|
|
||||||
| ### NATS Logger Configuration (`pipeline_visualization.yaml`) | ||||||
|
|
||||||
| The NATS logger behavior can be configured via YAML: | ||||||
| The NATS logger behavior can be configured using YAML: | ||||||
|
|
||||||
| ```yaml | ||||||
| nats_logger: | ||||||
|
|
@@ -134,7 +138,7 @@ flowchart TB | |||||
|
|
||||||
| ### Application (`cpp/` and `python/`) | ||||||
|
|
||||||
| The C++ and Python applications demonstrates a simple Holoscan pipeline with data logging: | ||||||
| The C++ and Python applications demonstrates a basic Holoscan pipeline with data logging: | ||||||
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| - **SourceOp**: Generates sine waves with varying frequencies (10-20 Hz) | ||||||
| - **ModulateOp**: Adds high-frequency modulation (300 Hz) to the signal | ||||||
|
|
@@ -145,31 +149,33 @@ The applications log both inputs and outputs of operators, allowing visualizatio | |||||
|
|
||||||
| ### Python Visualizers (`visualizer/`) | ||||||
|
|
||||||
| Two visualization options are provided: | ||||||
| There are two Python visualizers. One is [static](#static-visualizer-visualizer_staticpy) and one is [dynamic](#dynamic-visualizer-visualizer_dynamicpy) and they both display: | ||||||
megnvidia marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Run-on sentence with repetitive structure. The three "and" conjunctions create awkward flow.
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||
|
|
||||||
| #### 1. Static Visualizer (`visualizer_static.py`) | ||||||
| - Real-time line plots of tensor data | ||||||
| - Stream name (operator.port format) | ||||||
| - IO type (Input/Output) | ||||||
| - Acquisition timestamp (nanoseconds) | ||||||
| - Publish timestamp (nanoseconds) | ||||||
|
|
||||||
| Use `start_visualizer.sh` to set the required Python path to the [flatbuffers](#flatbuffers-schemas-schemas) definitions and starts the visualizer. The script takes one parameter, its values are: | ||||||
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| - `dynamic`, to start the dynamic visualizer. | ||||||
| - `static`, to start the static visualizer. | ||||||
|
|
||||||
| #### Static Visualizer (`visualizer_static.py`) | ||||||
|
|
||||||
| The static visualizer can be used when the output data and format of the Holoscan pipeline is known or some data needs special formatting. | ||||||
|
|
||||||
| - Displays predefined data streams: `source.out`, `modulate.in`, `modulate.out`, `sink.in` | ||||||
| - Best for applications with known, fixed operator topology | ||||||
| - All graphs are created upfront and updated as data arrives | ||||||
|
|
||||||
| The static visualizer can be used when the output data and format of the Holoscan pipeline is known or some data needs special formatting. | ||||||
|
|
||||||
| #### 2. Dynamic Visualizer (`visualizer_dynamic.py`) | ||||||
| #### Dynamic Visualizer (`visualizer_dynamic.py`) | ||||||
|
|
||||||
| - Automatically discovers and creates graphs for new data streams | ||||||
| - Ideal for applications with dynamic or unknown operator configurations | ||||||
| - Graphs are created on-the-fly as new unique IDs are detected | ||||||
|
|
||||||
| There is a script `start_visualizer.sh` which sets the required Python path to the flatbuffers definitions and starts the visualizer. The script takes a parameter, `dynamic` starts the dynamic visualizer and `static` starts the static visualizer. | ||||||
|
|
||||||
| Both visualizers display: | ||||||
|
|
||||||
| - Real-time line plots of tensor data | ||||||
| - Stream name (operator.port format) | ||||||
| - IO type (Input/Output) | ||||||
| - Acquisition timestamp (nanoseconds) | ||||||
| - Publish timestamp (nanoseconds) | ||||||
|
|
||||||
| ### FlatBuffers Schemas (`schemas/`) | ||||||
megnvidia marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
|
|
@@ -178,13 +184,11 @@ The data format is defined using FlatBuffers for efficient serialization: | |||||
| - **message.fbs**: Top-level message structure with metadata | ||||||
| - **tensor.fbs**: Tensor data structure based on DLPack | ||||||
|
|
||||||
| ## Prerequisites | ||||||
| ## Visualizer Python Prerequisites | ||||||
bhashemian marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| All dependencies to run the application are installed automatically when using the `holohub run` command inside | ||||||
| the Holohub container. Since the visualizer is run outside the Holohub container, its dependencies must be | ||||||
| installed separately. See the next section for details. | ||||||
|
|
||||||
| ### Visualizer Python Dependencies | ||||||
| the Holohub container. Because the visualizer is run outside the Holohub container, its [dependencies](#visualizer-python-prerequisites) must be | ||||||
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| installed separately. | ||||||
|
|
||||||
| Install the required Python packages: | ||||||
|
|
||||||
|
|
@@ -205,7 +209,7 @@ Required packages: | |||||
|
|
||||||
| ### NATS Message Structure | ||||||
|
|
||||||
| Messages are published to the subject: `<subject_prefix>.data` (e.g., `nats_demo.data`) | ||||||
| Messages are published to the subject: `<subject_prefix>.data` (for example, `nats_demo.data`) | ||||||
|
|
||||||
| Each message is a FlatBuffer-serialized `Message` containing: | ||||||
|
|
||||||
|
|
@@ -250,7 +254,7 @@ Examples: | |||||
|
|
||||||
| 1. Check that the C++ application is running | ||||||
| 2. Verify the subject name matches (default: `nats_demo`) | ||||||
| 3. Click the "Connect" button in the web interface | ||||||
| 3. Click the **Connect** button in the web interface | ||||||
| 4. Check browser console for JavaScript errors | ||||||
|
|
||||||
| ### FlatBuffers Import Errors | ||||||
|
|
@@ -259,24 +263,24 @@ Examples: | |||||
|
|
||||||
| **Solution**: | ||||||
|
|
||||||
| - Ensure the FlatBuffers files were generated during build | ||||||
| - Set PYTHONPATH correctly: | ||||||
| 1. Ensure the FlatBuffers files were generated during build. | ||||||
| 1. Set `PYTHONPATH` correctly: | ||||||
|
|
||||||
| ```bash | ||||||
| export PYTHONPATH=$PYTHONPATH:/path/to/build/applications/pipeline_visualization/flatbuffers/ | ||||||
| ``` | ||||||
| ```bash | ||||||
| export PYTHONPATH=$PYTHONPATH:/path/to/build/applications/pipeline_visualization/flatbuffers/ | ||||||
| ``` | ||||||
|
|
||||||
| - Verify the files exist in the build directory | ||||||
| 1. Verify that the files exist in the build directory. | ||||||
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| ### No Data Displayed | ||||||
|
|
||||||
| **Problem**: Graphs are empty or show no data | ||||||
|
|
||||||
| **Solution**: | ||||||
|
|
||||||
| - Check that `log_tensor_data_content: true` in the YAML config | ||||||
| - Verify the operator names match between the app and visualizer | ||||||
| - For static visualizer, ensure the unique IDs in the code match your operators | ||||||
| - Verify that `log_tensor_data_content: true` is in the YAML config | ||||||
| - Verify that the operator names match, between the app and visualizer | ||||||
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
megnvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| - For static visualizer, ensure that the unique IDs in the code match your operators | ||||||
| - For dynamic visualizer, wait a few seconds for auto-discovery | ||||||
|
|
||||||
| ## Customization | ||||||
|
|
@@ -301,7 +305,7 @@ To visualize data from your own Holoscan operators: | |||||
| self._unique_ids = ["my_op.out", "my_other_op.in"] | ||||||
| ``` | ||||||
|
|
||||||
| 3. For dynamic visualizer, no changes needed - it will auto-discover! | ||||||
| 3. For dynamic visualizer, no changes needed - it will auto-discover. | ||||||
|
|
||||||
| ### Customizing Visualizations | ||||||
|
|
||||||
|
|
@@ -346,13 +350,13 @@ To access the visualizer from another machine: | |||||
|
|
||||||
| 1. Start the visualizer with host `0.0.0.0` (already configured) | ||||||
| 2. Ensure port 8050 is accessible through firewall | ||||||
| 3. Access via: `http://<server-ip>:8050` | ||||||
| 3. Access using: `http://<server-ip>:8050` | ||||||
|
|
||||||
| ### Multiple Applications | ||||||
|
|
||||||
| To run multiple Holoscan apps simultaneously: | ||||||
|
|
||||||
| 1. Use different subject prefixes for each app | ||||||
| 1. Use different subject prefixes for each app. | ||||||
| 2. Start multiple visualizer instances on different ports: | ||||||
|
|
||||||
| ```python | ||||||
|
|
||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.