Table of Contents

Class OnnxInferenceSettings

Namespace
VisioForge.Core.Types.X.AI
Assembly
VisioForge.Core.dll

Settings for a generic ONNX inference block/engine.

public class OnnxInferenceSettings

Inheritance

Derived

Inherited Members

Remarks

These settings describe how an ONNX model is loaded and how incoming video frames are preprocessed before inference. Frames are letterbox-resized to VisioForge.Core.Types.X.AI.OnnxInferenceSettings.InputWidth x VisioForge.Core.Types.X.AI.OnnxInferenceSettings.InputHeight, converted to the NCHW tensor layout, and (optionally) normalized to the 0..1 range.

Constructors

OnnxInferenceSettings()

Initializes a new instance of the VisioForge.Core.Types.X.AI.OnnxInferenceSettings class.

public OnnxInferenceSettings()

OnnxInferenceSettings(string)

Initializes a new instance of the VisioForge.Core.Types.X.AI.OnnxInferenceSettings class with the specified model path.

public OnnxInferenceSettings(string modelPath)

Parameters

modelPath string

The absolute path to the ONNX model file.

Properties

DeviceId

Gets or sets the device identifier for hardware execution providers (for example, the GPU index for CUDA/DirectML). Defaults to 0.

public int DeviceId { get; set; }

Property Value

int

FramesToSkip

Gets or sets the number of frames to skip between inference runs. A value of 0 runs inference on every frame. Higher values reduce CPU/GPU load at the cost of detection latency. Defaults to 0.

public int FramesToSkip { get; set; }

Property Value

int

InputHeight

Gets or sets the model input height, in pixels. Defaults to 640.

public int InputHeight { get; set; }

Property Value

int

InputWidth

Gets or sets the model input width, in pixels. Defaults to 640.

public int InputWidth { get; set; }

Property Value

int

ModelPath

Gets or sets the absolute path to the ONNX model file (.onnx).

public string ModelPath { get; set; }

Property Value

string

NormalizeTo01

Gets or sets a value indicating whether pixel values are normalized to the 0..1 range (divided by 255) during preprocessing. Defaults to true.

public bool NormalizeTo01 { get; set; }

Property Value

bool

Provider

Gets or sets the execution provider used by the inference session. Defaults to VisioForge.Core.Types.X.AI.OnnxExecutionProvider.Auto, which uses the fastest hardware provider present in the loaded ONNX Runtime native build (for example DirectML on a Windows DirectX 12 GPU) and falls back to the CPU when none is available.

public OnnxExecutionProvider Provider { get; set; }

Property Value

OnnxExecutionProvider