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.Sam2InputnewInstance(String url, int x, int y) Creates a newSam2Inputinstance with the image and a location.static Sam2Translator.Sam2InputnewInstance(Path path, int x, int y) Creates a newSam2Inputinstance with the image and a location.
-
Constructor Details
-
Sam2Input
Constructs aSam2Inputinstance.- 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 newSam2Inputinstance with the image and a location.- Parameters:
url- the image urlx- the X of the locationy- the Y of the location- Returns:
- a new
Sam2Inputinstance - Throws:
IOException- if failed to read image
-
newInstance
Creates a newSam2Inputinstance 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
Sam2Inputinstance - Throws:
IOException- if failed to read image
-