public class DetectedObjects extends Classifications
Application.CV.OBJECT_DETECTION
case.Modifier and Type | Class and Description |
---|---|
static class |
DetectedObjects.DetectedObject
A
DetectedObject represents a single potential detected Object for an image. |
Classifications.Classification, Classifications.ClassificationsSerializer
classNames, probabilities
Constructor and Description |
---|
DetectedObjects(java.util.List<java.lang.String> classNames,
java.util.List<java.lang.Double> probabilities,
java.util.List<BoundingBox> boundingBoxes)
Constructs a DetectedObjects, usually during post-processing.
|
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfObjects()
Returns the number of objects found in an image.
|
<T extends Classifications.Classification> |
item(int index)
Returns the item at a given index based on the order used to construct the
Classifications . |
java.lang.String |
toJson() |
public DetectedObjects(java.util.List<java.lang.String> classNames, java.util.List<java.lang.Double> probabilities, java.util.List<BoundingBox> boundingBoxes)
All three inputs(classNames, probabilities, boundingBoxes) should be parallel lists.
classNames
- the names of the objects that were detectedprobabilities
- the probability of the objects that were detectedboundingBoxes
- the bounding boxes of the objects that were detectedpublic <T extends Classifications.Classification> T item(int index)
Classifications
.item
in class Classifications
T
- the type of classification item for the taskindex
- the index of the item to returnclassifications.items().get(index)
public int getNumberOfObjects()
public java.lang.String toJson()
toJson
in interface ai.djl.util.JsonSerializable
toJson
in class Classifications