PreProcessStepsconvert_layout Method
Add 'convert layout' operation to specified layout.
Namespace: OpenVinoSharp.preprocessAssembly: OpenVINO_CSharp_API (in OpenVINO_CSharp_API.dll) Version: 2024.3.0.2+a9617c0f8f80882646d0eba11b88ae6cb17b3fb8
public PreProcessSteps convert_layout(
Layout layout
)
- layout Layout
- New layout after conversion. If not specified - destination layout is obtained from
appropriate model input properties.
PreProcessStepsReference to 'this' to allow chaining with other calls in a builder-like manner.
Adds appropriate 'transpose' operation between user layout and target layout.
Current implementation requires source and destination layout to have same number of dimensions
when user data has 'NHWC' layout (example is RGB image, [1, 224, 224, 3]) but model expects
planar input image ('NCHW', [1, 3, 224, 224]). Preprocessing may look like this:
var proc = PrePostProcessor(model);
proc.input().tensor().set_layout("NHWC"); // User data is NHWC
proc.input().preprocess().convert_layout("NCHW")) // model expects input as NCHW