Class ObjectDetectionOptions<T>
Configuration options for object detection models.
public class ObjectDetectionOptions<T>
Type Parameters
TThe numeric type used for calculations.
- Inheritance
-
ObjectDetectionOptions<T>
- Inherited Members
Remarks
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)
Properties
Architecture
The detection architecture to use.
public DetectionArchitecture Architecture { get; set; }
Property Value
Remarks
For Beginners: Different architectures have different trade-offs: - YOLO: Very fast, good accuracy, great for real-time applications - DETR: Transformer-based, no anchors, cleaner but slower - Faster R-CNN: Two-stage, highest accuracy but slower
Backbone
The backbone network type for feature extraction.
public BackboneType Backbone { get; set; }
Property Value
ClassNames
Class names for the detection classes.
public string[]? ClassNames { get; set; }
Property Value
- string[]
Remarks
If null, uses COCO class names by default.
ConfidenceThreshold
Minimum confidence score for a detection to be kept.
public double ConfidenceThreshold { get; set; }
Property Value
Remarks
For Beginners: Higher values mean fewer but more confident detections. Typical range: 0.25 to 0.5. Start with 0.25 and increase if you get too many false positives.
FreezeBackbone
Whether to freeze the backbone during fine-tuning.
public bool FreezeBackbone { get; set; }
Property Value
InputSize
Input image size [height, width] the model expects.
public int[] InputSize { get; set; }
Property Value
- int[]
Remarks
Images will be resized to this size before detection. Common sizes: 320 (fast), 640 (balanced), 1280 (high accuracy).
MaxDetections
Maximum number of detections to return per image.
public int MaxDetections { get; set; }
Property Value
Neck
The neck architecture for multi-scale feature fusion.
public NeckType Neck { get; set; }
Property Value
NmsThreshold
IoU threshold for Non-Maximum Suppression (NMS).
public double NmsThreshold { get; set; }
Property Value
Remarks
For Beginners: NMS removes duplicate detections of the same object. Lower values are more aggressive at removing overlapping boxes. Typical range: 0.4 to 0.6.
NumClasses
Number of object classes to detect.
public int NumClasses { get; set; }
Property Value
Remarks
Default is 80 (COCO dataset classes).
RandomSeed
Random seed for reproducibility.
public int? RandomSeed { get; set; }
Property Value
- int?
Size
The model size variant.
public ModelSize Size { get; set; }
Property Value
Remarks
For Beginners: Larger models are more accurate but slower: - Nano: Fastest, lowest accuracy, good for edge devices - Small: Fast with reasonable accuracy - Medium: Balanced speed and accuracy (recommended) - Large: High accuracy, slower inference - XLarge: Highest accuracy, slowest
UseMultiScale
Whether to use multi-scale inference for better accuracy.
public bool UseMultiScale { get; set; }
Property Value
Remarks
For Beginners: Multi-scale runs detection at multiple resolutions and combines results. More accurate but 2-3x slower.
UsePretrained
Whether to use pre-trained weights (COCO dataset).
public bool UsePretrained { get; set; }
Property Value
WeightsUrl
Custom URL to download weights from.
public string? WeightsUrl { get; set; }
Property Value
Remarks
If null, uses the default weights URL for the selected architecture and size.