holoscan.operators

This module provides a Python API to underlying C++ API Operators.

holoscan.operators.AJASourceOp

Operator to get a video stream from an AJA capture card.

holoscan.operators.BayerDemosaicOp

Format conversion operator.

holoscan.operators.FormatConverterOp

Format conversion operator.

holoscan.operators.HolovizOp(fragment[, ...])

Holoviz visualization operator using Holoviz module.

holoscan.operators.MultiAIInferenceOp

Multi-AI inference operator.

holoscan.operators.MultiAIPostprocessorOp

Multi-AI post-processing operator.

holoscan.operators.NTV2Channel

Members:

holoscan.operators.PingRxOp(fragment, *args, ...)

Simple receiver operator.

holoscan.operators.PingTxOp(fragment, *args, ...)

Simple transmitter operator.

holoscan.operators.SegmentationPostprocessorOp

Operator carrying out post-processing operations used in the ultrasound demo app.

holoscan.operators.TensorRTInferenceOp

Operator class to perform inference using TensorRT.

holoscan.operators.VideoStreamRecorderOp

Operator class to record the video stream to a file.

holoscan.operators.VideoStreamReplayerOp

Operator class to replay a video stream from a file.

class holoscan.operators.AJASourceOp

Bases: holoscan.core._core.Operator

Operator to get a video stream from an AJA capture card.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Initialize the operator.

setup(self, spec)

Define the operator specification.

start(self)

Operator start method.

stop(self)

Operator stop method.

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(self: holoscan.operators._operators.AJASourceOp, fragment: holoscan.core._core.Fragment, device: str = '0', channel: holoscan.operators._operators.NTV2Channel = <NTV2Channel.NTV2_CHANNEL1: 0>, width: int = 1920, height: int = 1080, framerate: int = 60, rdma: bool = False, enable_overlay: bool = False, overlay_channel: holoscan.operators._operators.NTV2Channel = <NTV2Channel.NTV2_CHANNEL2: 1>, overlay_rdma: bool = True, name: str = 'aja_source') → None

Operator to get a video stream from an AJA capture card.

Parameters
fragmentholoscan.core.Fragment

The fragment that the operator belongs to.

devicestr, optional

The device to target (e.g. “0” for device 0)

channelholoscan.operators.NTV2Channel or int, optional

The camera NTV2Channel to use for output.

widthint, optional

Width of the video stream.

heightint, optional

Height of the video stream.

framerateint, optional

Frame rate of the video stream.

rdmabool, optional

Boolean indicating whether RDMA is enabled.

enable_overlaybool, optional

Boolean indicating whether a separate overlay channel is enabled.

overlay_channelholoscan.operators.NTV2Channel or int, optional

The camera NTV2Channel to use for overlay output.

overlay_rdmabool, optional

Boolean indicating whether RDMA is enabled for the overlay.

namestr, optional

The name of the operator.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.operators._operators.AJASourceOp) → None

Initialize the operator.

This method is called only once when the operator is created for the first time, and uses a light-weight initialization.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(self: holoscan.operators._operators.AJASourceOp, spec: holoscan.core._core.OperatorSpec) → None

Define the operator specification.

Parameters
specholoscan.core.OperatorSpec

The operator specification.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

class holoscan.operators.BayerDemosaicOp

Bases: holoscan.gxf._gxf.GXFOperator

Format conversion operator.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

gxf_cid

The GXF component ID.

gxf_context

The GXF context of the component.

gxf_eid

The GXF entity ID.

gxf_typename

The GXF type name of the resource.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Initialize the operator.

setup(self, spec)

Define the operator specification.

start(self)

Operator start method.

stop(self)

Operator stop method.

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: holoscan.operators._operators.BayerDemosaicOp) -> None

Format conversion operator.

  1. __init__(self: holoscan.operators._operators.BayerDemosaicOp, fragment: holoscan.core._core.Fragment, pool: holoscan.resources._resources.Allocator, cuda_stream_pool: holoscan.resources._resources.CudaStreamPool, in_tensor_name: str = ‘’, out_tensor_name: str = ‘’, interpolation_mode: int = 0, bayer_grid_pos: int = 2, generate_alpha: bool = False, alpha_value: int = 255, name: str = ‘format_converter’) -> None

Format conversion operator.

Parameters
fragmentholoscan.core.Fragment

The fragment that the operator belongs to.

poolholoscan.resources.Allocator

Memory pool allocator used by the operator.

cuda_stream_poolholoscan.resources.CudaStreamPool

CUDA Stream pool to create CUDA streams

in_tensor_namestr, optional

The name of the input tensor.

out_tensor_namestr, optional

The name of the output tensor.

interpolation_modeint, optional

The interpolation model to be used for demosaicing. Values available at: https://docs.nvidia.com/cuda/npp/group__typedefs__npp.html#ga2b58ebd329141d560aa4367f1708f191

bayer_grid_posint, optional

The Bayer grid position (default of 2 = GBRG). Values available at: https://docs.nvidia.com/cuda/npp/group__typedefs__npp.html#ga5597309d6766fb2dffe155990d915ecb

generate_alphabool, optional

Generate alpha channel.

alpha_valueint, optional

Alpha value to be generated if generate_alpha is set to True.

namestr, optional

The name of the operator.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property gxf_cid

The GXF component ID.

property gxf_context

The GXF context of the component.

property gxf_eid

The GXF entity ID.

property gxf_typename

The GXF type name of the resource.

Returns
str

The GXF type name of the resource

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.operators._operators.BayerDemosaicOp) → None

Initialize the operator.

This method is called only once when the operator is created for the first time, and uses a light-weight initialization.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(self: holoscan.operators._operators.BayerDemosaicOp, spec: holoscan.core._core.OperatorSpec) → None

Define the operator specification.

Parameters
specholoscan.core.OperatorSpec

The operator specification.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

class holoscan.operators.FormatConverterOp

Bases: holoscan.core._core.Operator

Format conversion operator.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Initialize the operator.

setup(self, spec)

Define the operator specification.

start(self)

Operator start method.

stop(self)

Operator stop method.

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(self: holoscan.operators._operators.FormatConverterOp, fragment: holoscan.core._core.Fragment, pool: holoscan.resources._resources.Allocator, out_dtype: str, in_dtype: str = '', in_tensor_name: str = '', out_tensor_name: str = '', scale_min: float = 0.0, scale_max: float = 1.0, alpha_value: int = 255, resize_height: int = 0, resize_width: int = 0, resize_mode: int = 0, out_channel_order: List[int] = [], cuda_stream_pool: holoscan.resources._resources.CudaStreamPool = None, name: str = 'format_converter') → None

Format conversion operator.

Parameters
fragmentholoscan.core.Fragment

The fragment that the operator belongs to.

poolholoscan.resources.Allocator

Memory pool allocator used by the operator.

out_dtypestr

Destination data type (e.g. “RGB888” or “RGBA8888”).

in_dtypestr, optional

Source data type (e.g. “RGB888” or “RGBA8888”).

in_tensor_namestr, optional

The name of the input tensor.

out_tensor_namestr, optional

The name of the output tensor.

scale_minfloat, optional

Output will be clipped to this minimum value.

scale_maxfloat, optional

Output will be clipped to this maximum value.

alpha_valueint, optional

Unsigned integer in range [0, 255], indicating the alpha channel value to use when converting from RGB to RGBA.

resize_heightint, optional

Desired height for the (resized) output. Height will be unchanged if resize_height is 0.

resize_widthint, optional

Desired width for the (resized) output. Width will be unchanged if resize_width is 0.

resize_modeint, optional

Resize mode enum value corresponding to NPP’s nppiInterpolationMode (default=NPPI_INTER_CUBIC).

channel_ordersequence of int

Sequence of integers describing how channel values are permuted.

cuda_stream_poolholoscan.resources.CudaStreamPool, optional

CudaStreamPool instance to allocate CUDA streams.

namestr, optional

The name of the operator.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.operators._operators.FormatConverterOp) → None

Initialize the operator.

This method is called only once when the operator is created for the first time, and uses a light-weight initialization.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(self: holoscan.operators._operators.FormatConverterOp, spec: holoscan.core._core.OperatorSpec) → None

Define the operator specification.

Parameters
specholoscan.core.OperatorSpec

The operator specification.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

class holoscan.operators.HolovizOp(fragment, allocator=None, receivers=[], tensors=[], color_lut=[], window_title='Holoviz', display_name='DP-0', width=1920, height=1080, framerate=60, use_exclusive_display=False, fullscreen=False, headless=False, enable_render_buffer_input=False, enable_render_buffer_output=False, font_path='', cuda_stream_pool=None, name='holoviz_op')

Bases: holoscan.operators._operators.HolovizOp

Holoviz visualization operator using Holoviz module.

This is a Vulkan-based visualizer.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

DepthMapRenderMode

Members:

InputType

Members:

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Initialize the operator.

setup(self, spec)

Define the operator specification.

start(self)

Operator start method.

stop(self)

Operator stop method.

InputSpec

class DepthMapRenderMode

Bases: pybind11_builtins.pybind11_object

Members:

POINTS

LINES

TRIANGLES

Attributes

name

value

LINES =

POINTS =

TRIANGLES =

__init__(self: holoscan.operators._operators.HolovizOp.DepthMapRenderMode, value: int) → None

property name

property value

class InputSpec

Bases: pybind11_builtins.pybind11_object

__init__(self: holoscan.operators._operators.HolovizOp.InputSpec, arg0: str, arg1: holoscan.operators._operators.HolovizOp.InputType) → None

class InputType

Bases: pybind11_builtins.pybind11_object

Members:

UNKNOWN

COLOR

COLOR_LUT

POINTS

LINES

LINE_STRIP

TRIANGLES

CROSSES

RECTANGLES

OVALS

TEXT

DEPTH_MAP

DEPTH_MAP_COLOR

Attributes

name

value

COLOR =

COLOR_LUT =

CROSSES =

DEPTH_MAP =

DEPTH_MAP_COLOR =

LINES =

LINE_STRIP =

OVALS =

POINTS =

RECTANGLES =

TEXT =

TRIANGLES =

UNKNOWN =

__init__(self: holoscan.operators._operators.HolovizOp.InputType, value: int) → None

property name

property value

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(self: holoscan.operators._operators.HolovizOp, fragment: holoscan.core._core.Fragment, allocator: holoscan.resources._resources.Allocator, receivers: List[holoscan.core._core.IOSpec] = [], tensors: List[holoscan::ops::HolovizOp::InputSpec] = [], color_lut: List[List[float]] = [], window_title: str = 'Holoviz', display_name: str = 'DP-0', width: int = 1920, height: int = 1080, framerate: int = 60, use_exclusive_display: bool = False, fullscreen: bool = False, headless: bool = False, enable_render_buffer_input: bool = False, enable_render_buffer_output: bool = False, font_path: str = '', cuda_stream_pool: holoscan.resources._resources.CudaStreamPool = None, name: str = 'holoviz_op') → None

Holoviz visualization operator using Holoviz module.

This is a Vulkan-based visualizer.

Parameters
fragmentholoscan.core.Fragment

The fragment that the operator belongs to.

allocatorholoscan.core.Allocator, optional

Allocator used to allocate render buffer output. If None, will default to holoscan.core.UnboundedAllocator.

receiverssequence of holoscan.core.IOSpec, optional

List of input receivers.

tensorssequence of dict, optional

List of input tensors. Each tensor is defined by a dictionary where the ‘name’ key must correspond to a tensor sent to the operator’s input. See the notes section below for further details on how the tensor dictionary is defined.

color_lutlist of list of float, optional

Color lookup table for tensors of type ‘color_lut’. Should be shape (n_colors, 4).

window_titlestr, optional

Title on window canvas.

display_namestr, optional

In exclusive mode, name of display to use as shown with xrandr.

widthint, optional

Window width or display resolution width if in exclusive or fullscreen mode.

heightint, optional

Window height or display resolution width if in exclusive or fullscreen mode.

frameratefloat, optional

Display framerate in Hz if in exclusive mode.

use_exclusive_displaybool, optional

Enable exclusive display.

fullscreenbool, optional

Enable fullscreen window.

headlessbool, optional

Enable headless mode. No window is opened, the render buffer is output to port render_buffer_output.

enable_render_buffer_inputbool, optional

If True, an additional input port, named ‘render_buffer_input’ is added to the operator.

enable_render_buffer_outputbool, optional

If True, an additional output port, named ‘render_buffer_output’ is added to the operator.

font_pathstr, optional

File path for the font used for rendering text.

cuda_stream_poolholoscan.resources.CudaStreamPool, optional

CudaStreamPool instance to allocate CUDA streams.

namestr, optional

The name of the operator.

Notes

The tensors argument is used to specify the tensors to display. Each tensor is defined using a dictionary, that must, at minimum include a ‘name’ key that corresponds to a tensor found on the operator’s input. A ‘type’ key should also be provided to indicate the type of entry to display. The ‘type’ key will be one of {“color”, “color_lut”, “crosses”, “lines”, “line_strip”, “ovals”, “points”, “rectangles”, “text”, “triangles”, “depth_map”, “depth_map_color”, “unknown”}. The default type is “unknown” which will attempt to guess the corresponding type based on the tensor dimensions. Concrete examples are given below.

To show a single 2D RGB or RGBA image, use a list containing a single tensor of type ‘color’.

Copy
Copied!
            

tensors = [dict(name="video", type="color", opacity=1.0, priority=0)]

Here, the optional key opacity is used to scale the opacity of the tensor. The priority key is used to specify the render priority for layers. Layers with a higher priority will be rendered on top of those with a lower priority.

If we also had a “boxes” tensor representing rectangular bounding boxes, we could display them on top of the image like this.

Copy
Copied!
            

tensors = [ dict(name="video", type="color", priority=0), dict(name="boxes", type="rectangles", color=[1.0, 0.0, 0.0], line_width=2, priority=1), ]

where the color and line_width keys specify the color and line width of the bounding box.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.operators._operators.HolovizOp) → None

Initialize the operator.

This method is called only once when the operator is created for the first time, and uses a light-weight initialization.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(self: holoscan.operators._operators.HolovizOp, spec: holoscan.core._core.OperatorSpec) → None

Define the operator specification.

Parameters
specholoscan.core.OperatorSpec

The operator specification.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

class holoscan.operators.MultiAIInferenceOp

Bases: holoscan.core._core.Operator

Multi-AI inference operator.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Initialize the operator.

setup(self, spec)

Define the operator specification.

start(self)

Operator start method.

stop(self)

Operator stop method.

DataMap

DataVecMap

class DataMap

Bases: pybind11_builtins.pybind11_object

Methods

get_map(self)

insert(self)

__init__(self: holoscan.operators._operators.MultiAIInferenceOp.DataMap) → None

get_map(self: holoscan.operators._operators.MultiAIInferenceOp.DataMap) → Dict[str, str]

insert(self: holoscan.operators._operators.MultiAIInferenceOp.DataMap) → Dict[str, str]

class DataVecMap

Bases: pybind11_builtins.pybind11_object

Methods

get_map(self)

insert(self)

__init__(self: holoscan.operators._operators.MultiAIInferenceOp.DataVecMap) → None

get_map(self: holoscan.operators._operators.MultiAIInferenceOp.DataVecMap) → Dict[str, List[str]]

insert(self: holoscan.operators._operators.MultiAIInferenceOp.DataVecMap) → Dict[str, List[str]]

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(self: holoscan.operators._operators.MultiAIInferenceOp, fragment: holoscan.core._core.Fragment, backend: str, allocator: holoscan.resources._resources.Allocator, inference_map: dict, model_path_map: dict, pre_processor_map: dict, in_tensor_names: List[str] = [''], out_tensor_names: List[str] = [''], infer_on_cpu: bool = False, parallel_inference: bool = True, input_on_cuda: bool = True, output_on_cuda: bool = True, transmit_on_cuda: bool = True, enable_fp16: bool = False, is_engine_path: bool = False, name: str = 'multi_ai_inference') → None

Multi-AI inference operator.

Parameters
fragmentholoscan.core.Fragment

The fragment that the operator belongs to.

backend{“trt”, “onnxrt”}

Backend to use for inference. Set “trt” for TensorRT and “onnxrt” for the ONNX runtime.

allocatorholoscan.resources.Allocator

Memory allocator to use for the output.

inference_mapholoscan.operators.MultiAIInferenceOp.DataVecMap

Tensor to model map.

model_path_mapholoscan.operators.MultiAIInferenceOp.DataMap

Path to the ONNX model to be loaded.

pre_processor_mapholoscan.operators.MultiAIInferenceOp::DataVecMap

Pre processed data to model map.

in_tensor_namessequence of str, optional

Input tensors.

out_tensor_namessequence of str, optional

Output tensors.

infer_on_cpubool, optional

Whether to run the computation on the CPU instead of GPU.

parallel_inferencebool, optional

Whether to enable parallel execution.

input_on_cudabool, optional

Whether the input buffer is on the GPU.

output_on_cudabool, optional

Whether the output buffer is on the GPU.

transmit_on_cudabool, optional

Whether to transmit the message on the GPU.

enable_fp16bool, optional

Use 16-bit floating point computations.

is_engine_pathbool, optional

Whether the input model path mapping is for trt engine files

namestr, optional

The name of the operator.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.operators._operators.MultiAIInferenceOp) → None

Initialize the operator.

This method is called only once when the operator is created for the first time, and uses a light-weight initialization.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(self: holoscan.operators._operators.MultiAIInferenceOp, spec: holoscan.core._core.OperatorSpec) → None

Define the operator specification.

Parameters
specholoscan.core.OperatorSpec

The operator specification.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

class holoscan.operators.MultiAIPostprocessorOp

Bases: holoscan.core._core.Operator

Multi-AI post-processing operator.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Initialize the operator.

setup(self, spec)

Define the operator specification.

start(self)

Operator start method.

stop(self)

Operator stop method.

DataMap

DataVecMap

class DataMap

Bases: pybind11_builtins.pybind11_object

Methods

get_map(self)

insert(self)

__init__(self: holoscan.operators._operators.MultiAIPostprocessorOp.DataMap) → None

get_map(self: holoscan.operators._operators.MultiAIPostprocessorOp.DataMap) → Dict[str, str]

insert(self: holoscan.operators._operators.MultiAIPostprocessorOp.DataMap) → Dict[str, str]

class DataVecMap

Bases: pybind11_builtins.pybind11_object

Methods

get_map(self)

insert(self)

__init__(self: holoscan.operators._operators.MultiAIPostprocessorOp.DataVecMap) → None

get_map(self: holoscan.operators._operators.MultiAIPostprocessorOp.DataVecMap) → Dict[str, List[str]]

insert(self: holoscan.operators._operators.MultiAIPostprocessorOp.DataVecMap) → Dict[str, List[str]]

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(self: holoscan.operators._operators.MultiAIPostprocessorOp, fragment: holoscan.core._core.Fragment, allocator: holoscan.resources._resources.Allocator, process_operations: dict = {}, processed_map: dict = {}, in_tensor_names: List[str] = [], out_tensor_names: List[str] = [], input_on_cuda: bool = False, output_on_cuda: bool = False, transmit_on_cuda: bool = False, disable_transmitter: bool = False, name: str = 'multi_ai_postprocessor') → None

Multi-AI post-processing operator.

Parameters
fragmentholoscan.core.Fragment

The fragment that the operator belongs to.

allocatorholoscan.resources.Allocator

Memory allocator to use for the output.

post_processor_mapholoscan.operators.MultiAIPostprocessorOp.DataVecMap

All post processor settings for each model.

process_operationsholoscan.operators.MultiAIPostprocessorOp.DataVecMap

Operations in sequence on tensors.

processed_mapholoscan.operators.MultiAIPostprocessorOp::DataVecMap

Input-output tensor mapping.

in_tensor_namessequence of str, optional

Names of input tensors in the order to be fed into the operator.

out_tensor_namessequence of str, optional

Names of output tensors in the order to be fed into the operator.

input_on_cudabool, optional

Whether the input buffer is on the GPU.

output_on_cudabool, optional

Whether the output buffer is on the GPU.

transmit_on_cudabool, optional

Whether to transmit the message on the GPU.

disable_transmitterbool, optional

If True, disable the transmitter output port of the operator.

namestr, optional

The name of the operator.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.operators._operators.MultiAIPostprocessorOp) → None

Initialize the operator.

This method is called only once when the operator is created for the first time, and uses a light-weight initialization.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(self: holoscan.operators._operators.MultiAIPostprocessorOp, spec: holoscan.core._core.OperatorSpec) → None

Define the operator specification.

Parameters
specholoscan.core.OperatorSpec

The operator specification.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

class holoscan.operators.NTV2Channel

Bases: pybind11_builtins.pybind11_object

Members:

NTV2_CHANNEL1

NTV2_CHANNEL2

NTV2_CHANNEL3

NTV2_CHANNEL4

NTV2_CHANNEL5

NTV2_CHANNEL6

NTV2_CHANNEL7

NTV2_CHANNEL8

NTV2_MAX_NUM_CHANNELS

NTV2_CHANNEL_INVALID

Attributes

name

value

NTV2_CHANNEL1 =

NTV2_CHANNEL2 =

NTV2_CHANNEL3 =

NTV2_CHANNEL4 =

NTV2_CHANNEL5 =

NTV2_CHANNEL6 =

NTV2_CHANNEL7 =

NTV2_CHANNEL8 =

NTV2_CHANNEL_INVALID =

NTV2_MAX_NUM_CHANNELS =

__init__(self: holoscan.operators._operators.NTV2Channel, value: int) → None

property name

property value

class holoscan.operators.PingRxOp(fragment, *args, **kwargs)

Bases: holoscan.core.Operator

Simple receiver operator.

This operator has a single input port:

input: “in”

This is an example of a native operator with one input port. On each tick, it receives an integer from the “in” port.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Operator initialization method.

setup(spec)

Default implementation of setup method.

start(self)

Operator start method.

stop(self)

Operator stop method.

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(self: holoscan.core._core.Operator, arg0: object, arg1: holoscan::Fragment, *args, **kwargs) → None

Operator class.

Can be initialized with any number of Python positional and keyword arguments.

If a name keyword argument is provided, it must be a str and will be used to set the name of the Operator.

Condition classes will be added to self.conditions, Resource classes will be added to self.resources, and any other arguments will be cast from a Python argument type to a C++ Arg and stored in self.args. (For details on how the casting is done, see the py_object_to_arg utility). When a Condition or Resource is provided via a kwarg, it’s name will be automatically be updated to the name of the kwarg.

Parameters
fragmentholoscan.core.Fragment

The holoscan.core.Fragment (or holoscan.core.Application) to which this Operator will belong.

*args

Positional arguments.

**kwargs

Keyword arguments.

Raises
RuntimeError

If name kwarg is provided, but is not of str type. If multiple arguments of type Fragment are provided. If any other arguments cannot be converted to Arg type via py_object_to_arg.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.core._core.Operator) → None

Operator initialization method.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(spec: holoscan.core._core.OperatorSpec)

Default implementation of setup method.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

class holoscan.operators.PingTxOp(fragment, *args, **kwargs)

Bases: holoscan.core.Operator

Simple transmitter operator.

This operator has a single output port:

output: “out”

On each tick, it transmits an integer to the “out” port.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Operator initialization method.

setup(spec)

Default implementation of setup method.

start(self)

Operator start method.

stop(self)

Operator stop method.

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(self: holoscan.core._core.Operator, arg0: object, arg1: holoscan::Fragment, *args, **kwargs) → None

Operator class.

Can be initialized with any number of Python positional and keyword arguments.

If a name keyword argument is provided, it must be a str and will be used to set the name of the Operator.

Condition classes will be added to self.conditions, Resource classes will be added to self.resources, and any other arguments will be cast from a Python argument type to a C++ Arg and stored in self.args. (For details on how the casting is done, see the py_object_to_arg utility). When a Condition or Resource is provided via a kwarg, it’s name will be automatically be updated to the name of the kwarg.

Parameters
fragmentholoscan.core.Fragment

The holoscan.core.Fragment (or holoscan.core.Application) to which this Operator will belong.

*args

Positional arguments.

**kwargs

Keyword arguments.

Raises
RuntimeError

If name kwarg is provided, but is not of str type. If multiple arguments of type Fragment are provided. If any other arguments cannot be converted to Arg type via py_object_to_arg.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.core._core.Operator) → None

Operator initialization method.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(spec: holoscan.core._core.OperatorSpec)

Default implementation of setup method.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

class holoscan.operators.SegmentationPostprocessorOp

Bases: holoscan.core._core.Operator

Operator carrying out post-processing operations used in the ultrasound demo app.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Operator initialization method.

setup(self, spec)

Define the operator specification.

start(self)

Operator start method.

stop(self)

Operator stop method.

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(self: holoscan.operators._operators.SegmentationPostprocessorOp, fragment: holoscan.core._core.Fragment, allocator: holoscan.resources._resources.Allocator, in_tensor_name: str = '', network_output_type: str = 'softmax', data_format: str = 'hwc', cuda_stream_pool: holoscan.resources._resources.CudaStreamPool = None, name: str = 'segmentation_postprocessor') → None

Operator carrying out post-processing operations used in the ultrasound demo app.

Parameters
fragmentholoscan.core.Fragment

The fragment that the operator belongs to.

allocatorholoscan.resources.Allocator

Memory allocator to use for the output.

in_tensor_namestr, optional

Name of the input tensor.

network_output_typestr, optional

Network output type (e.g. ‘softmax’).

data_formatstr, optional

Data format of network output.

cuda_stream_poolholoscan.resources.CudaStreamPool, optional

CudaStreamPool instance to allocate CUDA streams.

namestr, optional

The name of the operator.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.core._core.Operator) → None

Operator initialization method.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(self: holoscan.operators._operators.SegmentationPostprocessorOp, spec: holoscan.core._core.OperatorSpec) → None

Define the operator specification.

Parameters
specholoscan.core.OperatorSpec

The operator specification.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

class holoscan.operators.TensorRTInferenceOp

Bases: holoscan.gxf._gxf.GXFOperator

Operator class to perform inference using TensorRT.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

gxf_cid

The GXF component ID.

gxf_context

The GXF context of the component.

gxf_eid

The GXF entity ID.

gxf_typename

The GXF type name of the resource.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Initialize the operator.

setup(self, spec)

Define the operator specification.

start(self)

Operator start method.

stop(self)

Operator stop method.

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(self: holoscan.operators._operators.TensorRTInferenceOp, fragment: holoscan.core._core.Fragment, model_file_path: str, engine_cache_dir: str, input_tensor_names: List[str], input_binding_names: List[str], output_tensor_names: List[str], output_binding_names: List[str], pool: holoscan.resources._resources.Allocator, cuda_stream_pool: holoscan.resources._resources.CudaStreamPool, plugins_lib_namespace: str = '', force_engine_update: bool = False, max_workspace_size: int = 67108864, max_batch_size: int = 1, enable_fp16_: bool = False, relaxed_dimension_check: bool = True, verbose: bool = False, name: str = 'tensor_rt_inference') → None

Operator class to perform inference using TensorRT.

Parameters
fragmentFragment

The fragment that the operator belongs to.

model_file_pathstr

Path to the ONNX model to be loaded.

engine_cache_dirstr

Path to a folder containing cached engine files to be serialized and loaded from.

input_tensor_namessequence of str

Names of input tensors in the order to be fed into the model.

input_binding_namessequence of str

Names of input bindings as in the model in the same order of what is provided in input_tensor_names.

output_tensor_namessequence of str

Names of output tensors in the order to be retrieved from the model.

output_binding_namessequence of str

Names of output bindings as in the model in the same order of what is provided in output_tensor_names.

poolholoscan.resources.Allocator

Allocator instance for output tensors.

cuda_stream_poolholoscan.resources.CudaStreamPool

CudaStreamPool instance to allocate CUDA streams.

plugins_lib_namespacestr

Namespace used to register all the plugins in this library.

force_engine_updatebool, optional

Always update engine regardless of whether there is an existing engine file. Warning: this may take minutes to complete, so is False by default.

max_workspace_sizeint, optional

Size of working space in bytes.

max_batch_sizeint, optional

Maximum possible batch size in case the first dimension is dynamic and used as batch size.

enable_fp16bool, optional

Enable inference with FP16 and FP32 fallback.

relaxed_dimension_checkbool, optional

Ignore dimensions of 1 for input tensor dimension check.

verbosebool, optional

Enable verbose logging to the console.

namestr, optional

The name of the operator.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property gxf_cid

The GXF component ID.

property gxf_context

The GXF context of the component.

property gxf_eid

The GXF entity ID.

property gxf_typename

The GXF type name of the resource.

Returns
str

The GXF type name of the resource

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.operators._operators.TensorRTInferenceOp) → None

Initialize the operator.

This method is called only once when the operator is created for the first time, and uses a light-weight initialization.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(self: holoscan.operators._operators.TensorRTInferenceOp, spec: holoscan.core._core.OperatorSpec) → None

Define the operator specification.

Parameters
specholoscan.core.OperatorSpec

The operator specification.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

class holoscan.operators.VideoStreamRecorderOp

Bases: holoscan.core._core.Operator

Operator class to record the video stream to a file.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Initialize the operator.

setup(self, spec)

Define the operator specification.

start(self)

Operator start method.

stop(self)

Operator stop method.

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(self: holoscan.operators._operators.VideoStreamRecorderOp, fragment: holoscan.core._core.Fragment, directory: str, basename: str, flush_on_tick: bool = False, name: str = 'recorder') → None

Operator class to record the video stream to a file.

Parameters
fragmentholoscan.core.Fragment

The fragment that the operator belongs to.

directorystr

Directory path for storing files.

basenamestr

User specified file name without extension.

flush_on_tickbool, optional

Flushes output buffer on every tick when True.

namestr, optional

The name of the operator.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.operators._operators.VideoStreamRecorderOp) → None

Initialize the operator.

This method is called only once when the operator is created for the first time, and uses a light-weight initialization.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(self: holoscan.operators._operators.VideoStreamRecorderOp, spec: holoscan.core._core.OperatorSpec) → None

Define the operator specification.

Parameters
specholoscan.core.OperatorSpec

The operator specification.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

class holoscan.operators.VideoStreamReplayerOp

Bases: holoscan.core._core.Operator

Operator class to replay a video stream from a file.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

Methods

OperatorType

Members:

add_arg(*args, **kwargs)

Overloaded function.

compute(self, arg0, arg1, arg2)

Operator compute method.

initialize(self)

Initialize the operator.

setup(self, spec)

Define the operator specification.

start(self)

Operator start method.

stop(self)

Operator stop method.

class OperatorType

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

Attributes

name

value

GXF =

NATIVE =

__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None

property name

property value

__init__(self: holoscan.operators._operators.VideoStreamReplayerOp, fragment: holoscan.core._core.Fragment, directory: str, basename: str, batch_size: int = 1, ignore_corrupted_entities: bool = True, frame_rate: float = 1.0, realtime: bool = True, repeat: bool = False, count: int = 0, name: str = 'format_converter') → None

Operator class to replay a video stream from a file.

Parameters
fragmentholoscan.core.Fragment

The fragment that the operator belongs to.

directorystr

Directory path for reading files from.

basenamestr

User specified file name without extension.

batch_sizeint, optional

Number of entities to read and publish for one tick.

ignore_corrupted_entitiesbool, optional

If an entity could not be deserialized, it is ignored by default; otherwise a failure is generated.

frame_ratefloat, optional

Frame rate to replay. If zero value is specified, it follows timings in timestamps.

realtimebool, optional

Playback video in realtime, based on frame_rate or timestamps.

repeatbool, optional

Repeat video stream in a loop.

countint, optional

Number of frame counts to playback. If zero value is specified, it is ignored. If the count is less than the number of frames in the video, it would finish early.

namestr, optional

The name of the operator.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

Returns
arglistholoscan.core.ArgList

compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

Operator compute method. This method defines the primary computation to be executed by the operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment that the operator belongs to.

Returns
nameholoscan.core.Fragment

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

Returns
idint

initialize(self: holoscan.operators._operators.VideoStreamReplayerOp) → None

Initialize the operator.

This method is called only once when the operator is created for the first time, and uses a light-weight initialization.

property name

The name of the operator.

Returns
namestr

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(self: holoscan.operators._operators.VideoStreamReplayerOp, spec: holoscan.core._core.OperatorSpec) → None

Define the operator specification.

Parameters
specholoscan.core.OperatorSpec

The operator specification.

property spec

start(self: holoscan.core._core.Operator) → None

Operator start method.

stop(self: holoscan.core._core.Operator) → None

Operator stop method.

© Copyright 2022-2023, NVIDIA. Last updated on Jul 28, 2023.