Class SegmentImageConfig.Builder

java.lang.Object
com.google.genai.types.SegmentImageConfig.Builder
Enclosing class:
SegmentImageConfig

public abstract static class SegmentImageConfig.Builder extends Object
Builder for SegmentImageConfig.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • httpOptions

      public abstract SegmentImageConfig.Builder httpOptions(HttpOptions httpOptions)
      Setter for httpOptions.

      httpOptions: Used to override HTTP request options.

    • httpOptions

      public SegmentImageConfig.Builder httpOptions(HttpOptions.Builder httpOptionsBuilder)
      Setter for httpOptions builder.

      httpOptions: Used to override HTTP request options.

    • mode

      public abstract SegmentImageConfig.Builder mode(SegmentMode mode)
      Setter for mode.

      mode: The segmentation mode to use.

    • mode

      @CanIgnoreReturnValue public SegmentImageConfig.Builder mode(SegmentMode.Known knownType)
      Setter for mode given a known enum.

      mode: The segmentation mode to use.

    • mode

      @CanIgnoreReturnValue public SegmentImageConfig.Builder mode(String mode)
      Setter for mode given a string.

      mode: The segmentation mode to use.

    • maxPredictions

      public abstract SegmentImageConfig.Builder maxPredictions(Integer maxPredictions)
      Setter for maxPredictions.

      maxPredictions: The maximum number of predictions to return up to, by top confidence score.

    • confidenceThreshold

      public abstract SegmentImageConfig.Builder confidenceThreshold(Float confidenceThreshold)
      Setter for confidenceThreshold.

      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 SegmentImageConfig.Builder maskDilation(Float maskDilation)
      Setter for maskDilation.

      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 SegmentImageConfig.Builder binaryColorThreshold(Float binaryColorThreshold)
      Setter for binaryColorThreshold.

      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.

    • build

      public abstract SegmentImageConfig build()