Class YoloDetector
- Namespace
- VisioForge.Core.ONNX
- Assembly
- VisioForge.Core.ONNX.dll
YOLOv8/v11 object detector built on top of VisioForge.Core.ONNX.OnnxInferenceEngine.
public class YoloDetector : IDisposableInheritance
Implements
Inherited Members
Remarks
Decodes the transposed YOLOv8/v11 output tensor of shape [1, 4 + numClasses, numAnchors] (4 bbox values followed by per-class scores, no objectness term), applies the confidence threshold and class-wise non-maximum suppression, maps boxes from the letterboxed model space back to the original frame coordinates, and optionally draws the detections onto the RGBA frame. The underlying engine is lazily initialized on the first VisioForge.Core.ONNX.YoloDetector.Process(VisioForge.Core.Types.X.VideoFrameX) call.
Constructors
YoloDetector(YoloDetectorSettings)
Initializes a new instance of the VisioForge.Core.ONNX.YoloDetector class.
public YoloDetector(YoloDetectorSettings settings)Parameters
settingsYoloDetectorSettings-
The detector settings.
Exceptions
- ArgumentNullException
-
Thrown when
settingsis null.
Properties
ActiveProvider
Gets the execution provider the underlying inference session actually engaged (valid after VisioForge.Core.ONNX.YoloDetector.Init).
public OnnxExecutionProvider ActiveProvider { get; }Property Value
- OnnxExecutionProvider
Methods
Dispose()
Releases the inference engine.
public void Dispose()Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
Init()
Loads the model and prepares the detector for inference.
public bool Init()Returns
- bool
-
trueif initialization succeeded; otherwise,false.
Process(VideoFrameX)
Runs detection on a single RGBA frame. The engine is lazily initialized on first use.
public OnnxDetection[] Process(VideoFrameX frame)Parameters
frameVideoFrameX-
The source RGBA frame.
Returns
- OnnxDetection[]
-
The detected objects, in source-frame coordinates; empty when nothing was found.
SetContext(BaseContext)
Sets the processing context used for logging and propagates it to the inference engine.
public void SetContext(BaseContext context)Parameters
contextBaseContext-
The context.