Package ai.djl.modality.cv.output
Class Mask
java.lang.Object
ai.djl.modality.cv.output.Rectangle
ai.djl.modality.cv.output.Mask
- All Implemented Interfaces:
BoundingBox,Serializable
A mask with a probability for each pixel within a bounding rectangle.
This class is usually used to record the results of an Image Segmentation task.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat[][]Returns the probability for each pixel.booleanReturns if the mask is for full image.
-
Constructor Details
-
Mask
public Mask(double x, double y, double width, double height, float[][] dist) Constructs a Mask with the given data.- Parameters:
x- the left coordinate of the bounding rectangley- the top coordinate of the bounding rectanglewidth- the width of the bounding rectangleheight- the height of the bounding rectangledist- the probability distribution for each pixel in the rectangle
-
Mask
public Mask(double x, double y, double width, double height, float[][] dist, boolean fullImageMask) Constructs a Mask with the given data.- Parameters:
x- the left coordinate of the bounding rectangley- the top coordinate of the bounding rectanglewidth- the width of the bounding rectangleheight- the height of the bounding rectangledist- the probability distribution for each pixel in the rectanglefullImageMask- if the mask if for full image
-
-
Method Details
-
getProbDist
public float[][] getProbDist()Returns the probability for each pixel.- Returns:
- the probability for each pixel
-
isFullImageMask
public boolean isFullImageMask()Returns if the mask is for full image.- Returns:
- if the mask is for full image
-