SegmentationSample<T>

Models & Types · AiDotNet.ComputerVision.Segmentation.Common

Represents a segmentation dataset sample with image, masks, and metadata.

For Beginners

A segmentation dataset contains pairs of images and their ground-truth masks. This class represents a single sample that can be used for training, evaluation, or visualization. It supports all segmentation task types including semantic labels, instance masks, and panoptic annotations.

Constructors

Constructor Summary
SegmentationSample()

Properties

Property Summary
Dictionary<int, string> ClassNames { get; set; } Class name mapping.
List<string> TextAnnotations { get; set; } Text annotations associated with this sample (for referring segmentation).
Tensor<T> Image { get; set; } Input image tensor [C, H, W].
Tensor<T> InstanceBoxes { get; set; } Instance bounding boxes [numInstances, 4] as (x1, y1, x2, y2).
Tensor<T> InstanceMasks { get; set; } Ground-truth instance masks [numInstances, H, W] (for instance/panoptic).
Tensor<T> PointCloud { get; set; } 3D point cloud [N, featureDim] (for point cloud segmentation).
Tensor<T> SemanticLabels { get; set; } Ground-truth semantic label map [H, W] (for semantic/panoptic).
Tensor<T> VideoFrames { get; set; } Video frames [numFrames, C, H, W] (for video segmentation).
Tensor<T> VideoMasks { get; set; } Per-frame masks [numFrames, numObjects, H, W] (for video segmentation).
Tensor<T> Volume { get; set; } 3D volume [C, D, H, W] (for medical volumetric segmentation).
int Height { get; set; } Image height in pixels.
int NumClasses { get; set; } Number of classes in the dataset.
int Width { get; set; } Image width in pixels.
int[] InstanceClassIds { get; set; } Instance class IDs [numInstances].
string DatasetName { get; set; } Dataset name this sample belongs to.
string SampleId { get; set; } Sample identifier (e.g., file name or dataset ID).