Jump to content

FrameSkipperOp

From RidgeRun Developer Wiki

🚧 Documentation is under development

The Holoscan SDK guide is currently under active development. Some sections may be incomplete or change without notice.

Questions? Contact RidgeRun or email to support@ridgerun.com.

Contents Pin






Preliminary reference
This reference is preliminary. The set of available operators and HSDK applications, along with their APIs and documented behavior, may change in future releases.


FrameSkipperOp

FrameSkipperOp decimates a CUDA tensor stream while preserving the complete retained sample. It receives every input so the upstream queue continues to drain, but forwards only one sample out of each configured group.


Workload management
For help choosing which frames to process and reducing the work done by later stages, contact RidgeRun.


Input arguments

The constructor takes keep_one_in_n. It must be greater than zero. With keep_one_in_n = 1, every sample is forwarded; with keep_one_in_n = 3, samples 3, 6, 9 and so on are emitted.

Ports and data contract

Port Memory Queue Trigger Contract
input CUDA device 1 OnEach U8 rank-3 tensor. The operator does not impose a fixed width or height.
output Same backing as input 1 Same activation The retained input tensor is forwarded without allocating or copying a new payload.

The operator counts every activation, drops non-retained samples and emits the selected sample with its capture time, frame ID, trace context and semantic flags unchanged.

Camera or generator -> FrameSkipperOp -> inference or display

Build

Follow Holoscan RidgeRun Build and Installation for the module build and installation. The operator-specific include, target, and runtime requirements are listed below.

Include frame_skipper/frame_skipper.hpp and link holoscan::frame_skipper.

Example

The counter starts at zero and increments after every received sample. A sample is emitted when the one-based count is divisible by keep_one_in_n; therefore keep_one_in_n=3 forwards samples 3, 6, 9 and so on. The operator consumes discarded samples immediately instead of retaining them in a second queue. The input and output declarations use queue depth one and a device-byte-image contract, keeping the decimation stage bounded.

auto skip = graph.op<FrameSkipperOp>("skip", 3U);
graph.add_flow(camera->frame, skip->input);
graph.add_flow(skip->output, inference->input);

The retained sample is emitted with output.emit(std::move(sample)), so its Tensor storage and metadata are transferred without a payload copy. This includes capture time, clock information, frame ID, trace data and semantic flags. Setting the factor to zero throws during construction; it is not interpreted as "drop everything".


This is decimation, not rate control
The operator does not change the upstream camera rate and does not inspect the tensor payload. It reduces downstream work by discarding complete samples after they reach the operator.


Source reference
You can find the source code at FrameSkipperOp.


Related pages


Cookies help us deliver our services. By using our services, you agree to our use of cookies.