SegmentationOutput<T>
Models & Types · AiDotNet.ComputerVision.Segmentation.Common
Unified output type for all segmentation tasks, combining semantic, instance, and panoptic results.
For Beginners
This is the universal result type returned by segmentation models. Depending on the model, different fields will be populated:
- Semantic models fill
ClassMapandClassProbabilities - Instance models fill
InstanceMasksandInstanceClasses - Panoptic models fill both semantic and instance fields plus
PanopticMap
Use TaskType to determine which fields are available.
Constructors
| Constructor | Summary |
|---|---|
SegmentationOutput() |
Properties
| Property | Summary |
|---|---|
List<SegmentInfo<T>> Segments { get; set; } |
Panoptic segment metadata. |
SegmentationTaskType TaskType { get; set; } |
The segmentation task that produced this output. |
T[] InstanceScores { get; set; } |
Confidence score for each detected instance [numInstances]. |
Tensor<T> ClassMap { get; set; } |
Per-pixel class label map [H, W]. |
Tensor<T> ClassProbabilities { get; set; } |
Per-pixel class probability map [numClasses, H, W]. |
Tensor<T> InstanceBoxes { get; set; } |
Bounding boxes for each instance [numInstances, 4] as (x1, y1, x2, y2). |
Tensor<T> InstanceIdMap { get; set; } |
Per-pixel instance ID map [H, W]. |
Tensor<T> InstanceMasks { get; set; } |
Per-instance binary masks [numInstances, H, W]. |
Tensor<T> Logits { get; set; } |
Raw logits output [numClasses, H, W] before softmax/argmax. |
Tensor<T> PanopticMap { get; set; } |
Combined panoptic ID map [H, W] encoded as classId * 1000 + instanceId. |
TimeSpan InferenceTime { get; set; } |
Time taken for inference. |
int ImageHeight { get; set; } |
Input image height. |
int ImageWidth { get; set; } |
Input image width. |
int NumClasses { get; set; } |
Number of classes in the output. |
int NumInstances { get; } |
Number of detected instances, derived from InstanceMasks (preferred) or InstanceClasses. |
int[] InstanceClasses { get; set; } |
Class ID for each detected instance [numInstances]. |
string[] ClassNames { get; set; } |
Class name labels (if available). |