Table of Contents

Class SegmentImageSource

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

A set of source input(s) for image segmentation.

public record SegmentImageSource : IEquatable<SegmentImageSource>
Inheritance
SegmentImageSource
Implements
Inherited Members

Properties

Image

The image to be segmented.

[JsonPropertyName("image")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Image? Image { get; set; }

Property Value

Image

Prompt

A text prompt for guiding the model during image segmentation. Required for prompt mode and semantic mode, disallowed for other modes.

[JsonPropertyName("prompt")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Prompt { get; set; }

Property Value

string

ScribbleImage

The brush scribble to guide segmentation. Required for the interactive mode, disallowed for other modes.

[JsonPropertyName("scribbleImage")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ScribbleImage? ScribbleImage { get; set; }

Property Value

ScribbleImage

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a SegmentImageSource object.

public static SegmentImageSource? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

SegmentImageSource

The deserialized SegmentImageSource object, or null if deserialization fails.