Package ai.djl.modality.cv.translator
Class Sam2Translator.Sam2Input
java.lang.Object
ai.djl.modality.cv.translator.Sam2Translator.Sam2Input
- Enclosing class:
- Sam2Translator
A class represents the segment anything input.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetImage()
Returns the image.Returns the locations.static Sam2Translator.Sam2Input
newInstance
(String url, int x, int y) Creates a newSam2Input
instance with the image and a location.static Sam2Translator.Sam2Input
newInstance
(Path path, int x, int y) Creates a newSam2Input
instance with the image and a location.
-
Constructor Details
-
Sam2Input
Constructs aSam2Input
instance.- Parameters:
image
- the imagepoints
- the locations on the imagelabels
- the labels for the locations (0: background, 1: foreground)
-
-
Method Details
-
getImage
Returns the image.- Returns:
- the image
-
getPoints
Returns the locations.- Returns:
- the locations
-
newInstance
Creates a newSam2Input
instance with the image and a location.- Parameters:
url
- the image urlx
- the X of the locationy
- the Y of the location- Returns:
- a new
Sam2Input
instance - Throws:
IOException
- if failed to read image
-
newInstance
Creates a newSam2Input
instance with the image and a location.- Parameters:
path
- the image file pathx
- the X of the locationy
- the Y of the location- Returns:
- a new
Sam2Input
instance - Throws:
IOException
- if failed to read image
-