Table of Contents

Class OpenVocabularyDetectorSettings

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

Settings for the open-vocabulary object detector block/engine (OWLv2 and Grounding DINO).

public class OpenVocabularyDetectorSettings : OnnxInferenceSettings

Inheritance

Inherited Members

Remarks

Unlike a fixed-class detector (YOLO), an open-vocabulary detector is queried with free-text VisioForge.Core.Types.X.AI.OpenVocabularyDetectorSettings.Prompts: each prompt string becomes a detectable class, reported as the detection Label with its zero-based prompt index as the ClassId. The tokenizer vocabulary is loaded from VisioForge.Core.Types.X.AI.OpenVocabularyDetectorSettings.VocabFilePath (and VisioForge.Core.Types.X.AI.OpenVocabularyDetectorSettings.MergesFilePath for the OWLv2 byte-level BPE; leave it null for the Grounding DINO WordPiece vocabulary). The inherited InputWidth/InputHeight are ignored: OWLv2 always runs at 960x960 and Grounding DINO uses the fixed size baked into its ONNX model.

Constructors

OpenVocabularyDetectorSettings()

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

public OpenVocabularyDetectorSettings()

OpenVocabularyDetectorSettings(string, string, string, string[])

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

public OpenVocabularyDetectorSettings(string modelPath, string vocabFilePath, string mergesFilePath, string[] prompts)

Parameters

modelPath string

The absolute path to the open-vocabulary ONNX model file.

vocabFilePath string

The absolute path to the tokenizer vocabulary file.

mergesFilePath string

The absolute path to the byte-level BPE merges file (OWLv2), or null for Grounding DINO.

prompts string[]

The free-text detection prompts.

Properties

BoxColor

Gets or sets the color used to draw detection boxes. Defaults to SkiaSharp.SKColors.Lime.

public SKColor BoxColor { get; set; }

Property Value

SKColor

BoxThickness

Gets or sets the stroke thickness, in pixels, used to draw detection boxes. Defaults to 2.

public float BoxThickness { get; set; }

Property Value

float

ConfidenceThreshold

Gets or sets the minimum confidence (0..1) a detection must reach to be reported. Defaults to 0.25.

public float ConfidenceThreshold { get; set; }

Property Value

float

DrawDetections

Gets or sets a value indicating whether detections are drawn onto the video frame. Defaults to true.

public bool DrawDetections { get; set; }

Property Value

bool

DrawLabels

Gets or sets a value indicating whether prompt labels and confidence values are drawn next to each box. Defaults to true.

public bool DrawLabels { get; set; }

Property Value

bool

IoUThreshold

Gets or sets the Intersection-over-Union threshold (0..1) used by class-wise non-maximum suppression. Defaults to 0.5.

public float IoUThreshold { get; set; }

Property Value

float

LabelFontSize

Gets or sets the label text size in pixels. When 0 (the default), the size is auto-scaled to the frame height so labels stay readable at any resolution. Set a positive value to use a fixed size.

public float LabelFontSize { get; set; }

Property Value

float

MaxDetections

Gets or sets the maximum number of detections returned per frame (highest confidence first). Defaults to 100.

public int MaxDetections { get; set; }

Property Value

int

MergesFilePath

Gets or sets the absolute path to the byte-level BPE merges.txt file. Required for OWLv2; leave null for Grounding DINO (its WordPiece tokenizer has no merges file).

public string MergesFilePath { get; set; }

Property Value

string

Model

Gets or sets the open-vocabulary model family the supplied ONNX model belongs to. Defaults to VisioForge.Core.Types.X.AI.OpenVocabularyModel.OWLv2.

public OpenVocabularyModel Model { get; set; }

Property Value

OpenVocabularyModel

Prompts

Gets or sets the free-text detection prompts. Each prompt becomes a detectable class; the detection Label is the prompt string and the ClassId is the prompt's zero-based index.

public string[] Prompts { get; set; }

Property Value

string[]

TextThreshold

Gets or sets the per-token text score threshold (0..1) used by Grounding DINO to filter which tokens in a prompt's span contribute to that prompt's score. Ignored by OWLv2. Defaults to 0.25.

public float TextThreshold { get; set; }

Property Value

float

VocabFilePath

Gets or sets the absolute path to the tokenizer vocabulary file: vocab.json for OWLv2 (byte-level BPE) or vocab.txt for Grounding DINO (BERT WordPiece).

public string VocabFilePath { get; set; }

Property Value

string