Class InstanceMask<T>
- Assembly
- AiDotNet.dll
Represents a single instance with bounding box and segmentation mask.
public class InstanceMask<T>
Type Parameters
TThe numeric type used for calculations.
- Inheritance
-
InstanceMask<T>
- Inherited Members
Constructors
InstanceMask(BoundingBox<T>, Tensor<T>, int, T)
Creates a new instance mask.
public InstanceMask(BoundingBox<T> box, Tensor<T> mask, int classId, T confidence)
Parameters
boxBoundingBox<T>maskTensor<T>classIdintconfidenceT
Properties
Box
Bounding box around the instance.
public BoundingBox<T> Box { get; set; }
Property Value
- BoundingBox<T>
ClassId
Class ID of the detected instance.
public int ClassId { get; set; }
Property Value
ClassName
Class name (if available).
public string? ClassName { get; set; }
Property Value
Confidence
Detection confidence score.
public T Confidence { get; set; }
Property Value
- T
Mask
Binary segmentation mask for this instance [height, width].
public Tensor<T> Mask { get; set; }
Property Value
- Tensor<T>
MaskConfidence
Mask confidence score (if separate from detection confidence).
public T MaskConfidence { get; set; }
Property Value
- T
Methods
ComputeMaskIoU(InstanceMask<T>, INumericOperations<T>)
Computes IoU with another instance mask.
public double ComputeMaskIoU(InstanceMask<T> other, INumericOperations<T> numOps)
Parameters
otherInstanceMask<T>numOpsINumericOperations<T>
Returns
GetMaskArea(INumericOperations<T>)
Gets the mask area (number of positive pixels).
public int GetMaskArea(INumericOperations<T> numOps)
Parameters
numOpsINumericOperations<T>