Please use. NET 5,. NET 6, NET 7,. NET 8, NET Framework 4.6, NET Framework 4.61, NET Framework 4.7, NET Framework 4.72, NET Framework 4.8, NET Framework 4.81, and. NET Core 3.1 versions

PreProcessStepsreverse_channels Method

Reverse channels operation.

Definition

Namespace: OpenVinoSharp.preprocess
Assembly: OpenVINO_CSharp_API (in OpenVINO_CSharp_API.dll) Version: 2024.3.0.2+a9617c0f8f80882646d0eba11b88ae6cb17b3fb8
C#
public PreProcessSteps reverse_channels()

Return Value

PreProcessSteps
Reference to 'this' to allow chaining with other calls in a builder-like manner.

Remarks

Adds appropriate operation which reverses channels layout. Operation requires layout having 'C' dimension Operation convert_color (RGB-BGR) does reversing of channels also, but only for NHWC layout

Example

when user data has 'NCHW' layout (example is [1, 3, 224, 224] RGB order) but model expects BGR planes order. Preprocessing may look like this:
C#
var proc = PrePostProcessor(function);
proc.input().preprocess().convert_layout({0, 3, 1, 2});

See Also