Class Sam2Translator.Sam2Input.Builder

java.lang.Object
ai.djl.modality.cv.translator.Sam2Translator.Sam2Input.Builder
Enclosing class:
Sam2Translator.Sam2Input

public static final class Sam2Translator.Sam2Input.Builder extends Object
The builder for Sam2Input.
  • Method Details

    • addPoint

      public Sam2Translator.Sam2Input.Builder addPoint(int x, int y)
      Adds a point to the Sam2Input.
      Parameters:
      x - the X coordinate
      y - the Y coordinate
      Returns:
      the builder
    • addPoint

      public Sam2Translator.Sam2Input.Builder addPoint(int x, int y, int label)
      Adds a point to the Sam2Input.
      Parameters:
      x - the X coordinate
      y - the Y coordinate
      label - the label of the point, 0 for background, 1 for foreground
      Returns:
      the builder
    • addPoint

      public Sam2Translator.Sam2Input.Builder addPoint(Point point, int label)
      Adds a point to the Sam2Input.
      Parameters:
      point - the point on image
      label - the label of the point, 0 for background, 1 for foreground
      Returns:
      the builder
    • addBox

      public Sam2Translator.Sam2Input.Builder addBox(int x, int y, int right, int bottom)
      Adds a box area to the Sam2Input.
      Parameters:
      x - the left coordinate
      y - the top coordinate
      right - the right coordinate
      bottom - the bottom coordinate
      Returns:
      the builder
    • visualize

      Sets the visualize for the Sam2Input.
      Returns:
      the builder
    • build

      public Sam2Translator.Sam2Input build()
      Builds the Sam2Input.
      Returns:
      the new Sam2Input