SegmentationPrompt<T>

Models & Types · AiDotNet.ComputerVision.Segmentation.Common

Represents a user prompt for interactive/promptable segmentation models.

For Beginners

A prompt tells the model what you want to segment. You can use different types of prompts:

  • Points: Click on the object (foreground) or background
  • Boxes: Draw a rectangle around the object
  • Masks: Provide a rough outline for refinement
  • Text: Describe what to segment in natural language

You can combine multiple prompt types for better results.

Constructors

Constructor Summary
SegmentationPrompt()

Properties

Property Summary
PromptType PrimaryPromptType { get; } Type of the primary prompt being used.
Tensor<T> AudioPrompt { get; set; } Audio prompt for multi-modal models (e.g., SEEM).
Tensor<T> Boxes { get; set; } Box prompts as [N, 4] (x1, y1, x2, y2 per box in pixel coordinates).
Tensor<T> MaskInput { get; set; } Mask prompt [H, W] where positive values indicate foreground.
Tensor<T> Points { get; set; } Point prompts as [N, 2] (x, y pairs in pixel coordinates).
Tensor<T> ReferenceImage { get; set; } Reference image for in-context learning (e.g., SegGPT).
Tensor<T> ReferenceMask { get; set; } Reference mask corresponding to the reference image.
bool ReturnLowResLogits { get; set; } Whether to return low-resolution logits for iterative refinement.
bool ReturnMultipleMasks { get; set; } Whether to return multiple mask proposals (SAM-style) or a single best mask.
int[] PointLabels { get; set; } Point labels: 1 = foreground, 0 = background, -1 = ambiguous.
int[] TargetObjectIds { get; set; } Target object IDs for tracking correction in video segmentation.
string NegativeTextPrompt { get; set; } Negative text prompt describing what to exclude.
string TextPrompt { get; set; } Text prompt for language-guided segmentation.