PromptableSegmentationBase<T>

Base Classes · AiDotNet.ComputerVision.Segmentation.Common

Abstract base class for promptable segmentation models like SAM that accept user prompts (points, boxes, masks) to segment specific objects.

Inheritance: NeuralNetworkBase<T> → SegmentationModelBase<T> → PromptableSegmentationBase<T>

Implements: IPromptableSegmentation<T>

Known derived types: EdgeSAM<T>, EfficientSAM<T>, FastSAM<T>, MobileSAM<T>, RepViTSAM<T>, SAM21<T>, SAMHQ<T>, SAM<T>, SEEM<T>, SegGPT<T>, SlimSAM<T>

For Beginners

Promptable segmentation lets you point at, draw a box around, or describe what you want to segment. The model first encodes the image (which is expensive but done once), then quickly processes each prompt against the encoded representation.

Models extending this base class: SAM, SAM 2, SAM-HQ, SegGPT, SEEM.

Properties

Property Summary
bool SupportsBoxPrompts { get; }
bool SupportsMaskPrompts { get; }
bool SupportsPointPrompts { get; }
bool SupportsTextPrompts { get; }

Methods

Method Summary
List<PromptedSegmentationResult<T>> SegmentEverything()
PromptedSegmentationResult<T> SegmentFromBox(Tensor<T> box)
PromptedSegmentationResult<T> SegmentFromMask(Tensor<T> mask)
PromptedSegmentationResult<T> SegmentFromPoints(Tensor<T> points, Tensor<T> labels)
void SetImage(Tensor<T> image)