AugmentedSample<T, TData>
Models & Types · AiDotNet.Augmentation.Image
Represents a sample with its data and associated spatial targets.
For Beginners
When you rotate an image, you also need to rotate any bounding boxes, keypoints, or segmentation masks associated with it. This class keeps all these elements together so they transform correctly.
How It Works
An augmented sample bundles together the data (e.g., image) with all its associated annotations that need to be transformed together when spatial augmentations are applied.
Constructors
| Constructor | Summary |
|---|---|
AugmentedSample(TData data) |
Creates a new augmented sample with only data. |
AugmentedSample(TData data, Vector<T> labels) |
Creates a new augmented sample with data and labels. |
Properties
| Property | Summary |
|---|---|
IDictionary<string, object> Metadata { get; set; } |
Gets or sets additional metadata for this sample. |
List<BoundingBox<T>> BoundingBoxes { get; set; } |
Gets or sets the bounding boxes for object detection. |
List<Keypoint<T>> Keypoints { get; set; } |
Gets or sets the keypoints for pose estimation. |
List<SegmentationMask<T>> Masks { get; set; } |
Gets or sets the segmentation masks. |
TData Data { get; set; } |
Gets or sets the primary data (e.g., image). |
Vector<T> Labels { get; set; } |
Gets or sets the label(s) for this sample. |
bool HasBoundingBoxes { get; } |
Gets whether this sample has any bounding boxes. |
bool HasKeypoints { get; } |
Gets whether this sample has any keypoints. |
bool HasMasks { get; } |
Gets whether this sample has any segmentation masks. |
bool HasSpatialTargets { get; } |
Gets whether this sample has any spatial targets. |
Methods
| Method | Summary |
|---|---|
AugmentedSample<T, TData> Clone() |
Creates a deep copy of this sample including all targets. |