ObjectDetectionOptions<T>
Options & Configuration · AiDotNet.Models.Options
Configuration options for object detection models.
Inheritance: ModelOptions → ObjectDetectionOptions<T>
Known derived types: DINOOptions<T>, RTDETROptions<T>
For Beginners
Object detection finds and locates objects in images. This class configures how the detection model works, including:
- Which architecture to use (YOLO, DETR, Faster R-CNN, etc.)
- Model size (smaller = faster, larger = more accurate)
- Detection thresholds (how confident the model must be)
Constructors
| Constructor | Summary |
|---|---|
ObjectDetectionOptions() |
Creates options with the historical default seed of 42. |
Properties
| Property | Summary |
|---|---|
BackboneType Backbone { get; set; } |
The backbone network type for feature extraction. |
DetectionArchitecture Architecture { get; set; } |
The detection architecture to use. |
DetrSetLossOptions SetPredictionLoss { get; set; } |
Set prediction loss used by TrainDetections on DETR-family detectors, or null for the detector’s published recipe (DETR, DINO or RT-DETR). |
ModelSize Size { get; set; } |
The model size variant. |
NeckType Neck { get; set; } |
The neck architecture for multi-scale feature fusion. |
TaskAlignedLossOptions TaskAlignedLoss { get; set; } |
Task-aligned assignment and loss used by TrainDetections on anchor-free YOLO detectors (YOLOv8, YOLOv9, YOLOv10, YOLOv11), or null for the published defaults. |
TwoStageDetectionLossOptions TwoStageLoss { get; set; } |
Proposal and region-of-interest sampling and loss weights used by TrainDetections on Faster R-CNN and Cascade R-CNN, or null for the published defaults. |
bool FreezeBackbone { get; set; } |
Whether to freeze the backbone during fine-tuning. |
bool UseMultiScale { get; set; } |
Whether to use multi-scale inference for better accuracy. |
bool UsePretrained { get; set; } |
Whether to use pre-trained weights (COCO dataset). |
double ConfidenceThreshold { get; set; } |
Minimum confidence score for a detection to be kept. |
double NmsThreshold { get; set; } |
IoU threshold for Non-Maximum Suppression (NMS). |
int MaxDetections { get; set; } |
Maximum number of detections to return per image. |
int NumClasses { get; set; } |
Number of object classes to detect. |
int[] InputSize { get; set; } |
Input image size [height, width] the model expects. |
string WeightsUrl { get; set; } |
Custom URL to download weights from. |
string[] ClassNames { get; set; } |
Class names for the detection classes. |