Class OnnxInferenceSettings
- Namespace
- VisioForge.Core.Types.X.AI
- Assembly
- VisioForge.Core.dll
Settings for a generic ONNX inference block/engine.
public class OnnxInferenceSettingsInheritance
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
modelPathstring-
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
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
InputHeight
Gets or sets the model input height, in pixels. Defaults to 640.
public int InputHeight { get; set; }Property Value
InputWidth
Gets or sets the model input width, in pixels. Defaults to 640.
public int InputWidth { get; set; }Property Value
ModelPath
Gets or sets the absolute path to the ONNX model file (.onnx).
public string ModelPath { get; set; }Property Value
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
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; }