Package ai.djl.modality.cv.translator
Class Sam2Translator.Sam2Input.Builder
java.lang.Object
ai.djl.modality.cv.translator.Sam2Translator.Sam2Input.Builder
- Enclosing class:
- Sam2Translator.Sam2Input
The builder for
Sam2Input
.-
Method Summary
Modifier and TypeMethodDescriptionaddBox
(int x, int y, int right, int bottom) Adds a box area to theSam2Input
.addPoint
(int x, int y) Adds a point to theSam2Input
.addPoint
(int x, int y, int label) Adds a point to theSam2Input
.Adds a point to theSam2Input
.build()
Builds theSam2Input
.Sets the visualize for theSam2Input
.
-
Method Details
-
addPoint
Adds a point to theSam2Input
.- Parameters:
x
- the X coordinatey
- the Y coordinate- Returns:
- the builder
-
addPoint
Adds a point to theSam2Input
.- Parameters:
x
- the X coordinatey
- the Y coordinatelabel
- the label of the point, 0 for background, 1 for foreground- Returns:
- the builder
-
addPoint
Adds a point to theSam2Input
.- Parameters:
point
- the point on imagelabel
- the label of the point, 0 for background, 1 for foreground- Returns:
- the builder
-
addBox
Adds a box area to theSam2Input
.- Parameters:
x
- the left coordinatey
- the top coordinateright
- the right coordinatebottom
- the bottom coordinate- Returns:
- the builder
-
visualize
Sets the visualize for theSam2Input
.- Returns:
- the builder
-
build
Builds theSam2Input
.- Returns:
- the new
Sam2Input
-