DetectionTrainingTarget<T>

Models & Types · AiDotNet.ComputerVision.Detection

A foreground label and a normalized center-format box used to train a detector.

How It Works

Coordinates are center-x, center-y, width and height, each relative to its own image dimension. Width and height must be positive. This type does not clip boxes or infer a coordinate format.

Constructors

Constructor Summary
DetectionTrainingTarget(int classId, T centerX, T centerY, T width, T height) Creates an immutable target with normalized center-format coordinates.

Properties

Property Summary
T CenterX { get; } Gets the horizontal center divided by image width.
T CenterY { get; } Gets the vertical center divided by image height.
T Height { get; } Gets box height divided by image height.
T Width { get; } Gets box width divided by image width.
int ClassId { get; } Gets the zero-based foreground class; the no-object class is never a target.

Methods

Method Summary
DetectionTrainingTarget<T> FromPixelXywh(int classId, T x, T y, T width, T height, int imageWidth, int imageHeight) Converts a pixel-space top-left xywh box without assuming a square image.