Class SegmentImageConfig

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.SegmentImageConfig

public abstract class SegmentImageConfig extends JsonSerializable
Configuration for segmenting an image.
  • Constructor Details

    • SegmentImageConfig

      public SegmentImageConfig()
  • Method Details

    • httpOptions

      public abstract Optional<HttpOptions> httpOptions()
      Used to override HTTP request options.
    • mode

      public abstract Optional<SegmentMode> mode()
      The segmentation mode to use.
    • maxPredictions

      public abstract Optional<Integer> maxPredictions()
      The maximum number of predictions to return up to, by top confidence score.
    • confidenceThreshold

      public abstract Optional<Float> confidenceThreshold()
      The confidence score threshold for the detections as a decimal value. Only predictions with a confidence score higher than this threshold will be returned.
    • maskDilation

      public abstract Optional<Float> maskDilation()
      A decimal value representing how much dilation to apply to the masks. 0 for no dilation. 1.0 means the masked area covers the whole image.
    • binaryColorThreshold

      public abstract Optional<Float> binaryColorThreshold()
      The binary color threshold to apply to the masks. The threshold can be set to a decimal value between 0 and 255 non-inclusive. Set to -1 for no binary color thresholding.
    • builder

      public static SegmentImageConfig.Builder builder()
      Instantiates a builder for SegmentImageConfig.
    • toBuilder

      public abstract SegmentImageConfig.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static SegmentImageConfig fromJson(String jsonString)
      Deserializes a JSON string to a SegmentImageConfig object.