Skip to content

Commit

Permalink
[#58168] examples: launch: Updated launch scripts to use inference co…
Browse files Browse the repository at this point in the history
…nfiguration

Signed-off-by: Grzegorz Latosinski <[email protected]>
  • Loading branch information
glatosinski committed Sep 13, 2024
1 parent 588f3de commit d0098b1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
6 changes: 5 additions & 1 deletion examples/mask_rcnn/launch/mask_rcnn_detectron_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def generate_launch_description() -> LaunchDescription:
)

scenario, scenario_arg = optional_args["scenario"]
inference_configuration, inference_configuration_arg = optional_args[
"inference_configuration"
]
inference_timeout_ms, timeout_arg = optional_args["inference_timeout_ms"]
preserve_output, preserve_arg = optional_args["preserve_output"]
publish_visualizations, gui_arg = optional_args["publish_visualizations"]
Expand All @@ -70,6 +73,7 @@ def generate_launch_description() -> LaunchDescription:
args.extend(
[
scenario_arg,
inference_configuration_arg,
timeout_arg,
preserve_arg,
gui_arg,
Expand All @@ -91,7 +95,7 @@ def generate_launch_description() -> LaunchDescription:
],
)

kenning_node = kenning_test_report_node(log_level)
kenning_node = kenning_test_report_node(log_level, inference_configuration)
gui_node = cvnode_manager_gui_node(log_level)
manager_node = cvnode_manager_node(
log_level=log_level,
Expand Down
11 changes: 9 additions & 2 deletions examples/mask_rcnn/launch/mask_rcnn_onnx_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"""Launches MaskRCNN node with ONNXRuntime backend."""

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable
from launch.actions import (
DeclareLaunchArgument,
SetEnvironmentVariable,
)
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node

Expand Down Expand Up @@ -38,6 +41,9 @@ def generate_launch_description() -> LaunchDescription:

# Arguments with default values
scenario, scenario_arg = optional_args["scenario"]
inference_configuration, inference_configuration_arg = optional_args[
"inference_configuration"
]
inference_timeout_ms, timeout_arg = optional_args["inference_timeout_ms"]
preserve_output, preserve_arg = optional_args["preserve_output"]
publish_visualizations, gui_arg = optional_args["publish_visualizations"]
Expand All @@ -47,6 +53,7 @@ def generate_launch_description() -> LaunchDescription:
args.extend(
[
scenario_arg,
inference_configuration_arg,
timeout_arg,
preserve_arg,
gui_arg,
Expand All @@ -69,7 +76,7 @@ def generate_launch_description() -> LaunchDescription:
],
)

kenning_node = kenning_test_report_node(log_level)
kenning_node = kenning_test_report_node(log_level, inference_configuration)
gui_node = cvnode_manager_gui_node(log_level)
manager_node = cvnode_manager_node(
log_level=log_level,
Expand Down
6 changes: 5 additions & 1 deletion examples/mask_rcnn/launch/mask_rcnn_tensorrt_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def generate_launch_description() -> LaunchDescription:

# Arguments with default values
scenario, scenario_arg = optional_args["scenario"]
inference_configuration, inference_configuration_arg = optional_args[
"inference_configuration"
]
inference_timeout_ms, timeout_arg = optional_args["inference_timeout_ms"]
preserve_output, preserve_arg = optional_args["preserve_output"]
publish_visualizations, gui_arg = optional_args["publish_visualizations"]
Expand All @@ -49,6 +52,7 @@ def generate_launch_description() -> LaunchDescription:
args.extend(
[
scenario_arg,
inference_configuration_arg,
timeout_arg,
preserve_arg,
gui_arg,
Expand All @@ -69,7 +73,7 @@ def generate_launch_description() -> LaunchDescription:
],
)

kenning_node = kenning_test_report_node(log_level)
kenning_node = kenning_test_report_node(log_level, inference_configuration)
gui_node = cvnode_manager_gui_node(log_level)
manager_node = cvnode_manager_node(
log_level=log_level,
Expand Down
5 changes: 4 additions & 1 deletion examples/mask_rcnn/launch/mask_rcnn_torchscript_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ def generate_launch_description() -> LaunchDescription:

# Arguments with default values
scenario, scenario_arg = optional_args["scenario"]
inference_configuration, inference_configuration_arg = optional_args[
"inference_configuration"
]
inference_timeout_ms, timeout_arg = optional_args["inference_timeout_ms"]
preserve_output, preserve_arg = optional_args["preserve_output"]
publish_visualizations, gui_arg = optional_args["publish_visualizations"]
Expand Down Expand Up @@ -79,7 +82,7 @@ def generate_launch_description() -> LaunchDescription:
],
)

kenning_node = kenning_test_report_node(log_level)
kenning_node = kenning_test_report_node(log_level, inference_configuration)
gui_node = cvnode_manager_gui_node(log_level)
manager_node = cvnode_manager_node(
log_level=log_level,
Expand Down
8 changes: 6 additions & 2 deletions examples/yolact/launch/yolact_tensorrt_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0

"""Launches YOLACT node with TensorRT backend."""
"""Launches YOLACT CVNode with TensorRT backend."""

from launch import LaunchDescription
from launch.actions import (
Expand Down Expand Up @@ -41,6 +41,9 @@ def generate_launch_description() -> LaunchDescription:

# Arguments with default values
scenario, scenario_arg = optional_args["scenario"]
inference_configuration, inference_configuration_arg = optional_args[
"inference_configuration"
]
inference_timeout_ms, timeout_arg = optional_args["inference_timeout_ms"]
preserve_output, preserve_arg = optional_args["preserve_output"]
publish_visualizations, gui_arg = optional_args["publish_visualizations"]
Expand All @@ -49,6 +52,7 @@ def generate_launch_description() -> LaunchDescription:
args.extend(
[
scenario_arg,
inference_configuration_arg,
timeout_arg,
preserve_arg,
gui_arg,
Expand All @@ -69,7 +73,7 @@ def generate_launch_description() -> LaunchDescription:
],
)

kenning_node = kenning_test_report_node(log_level)
kenning_node = kenning_test_report_node(log_level, inference_configuration)
gui_node = cvnode_manager_gui_node(log_level)
manager_node = cvnode_manager_node(
log_level=log_level,
Expand Down

0 comments on commit d0098b1

Please sign in to comment.