Class DetectedObjects

    • Constructor Detail

      • DetectedObjects

        public 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.

        All three inputs(classNames, probabilities, boundingBoxes) should be parallel lists.

        Parameters:
        classNames - the names of the objects that were detected
        probabilities - the probability of the objects that were detected
        boundingBoxes - the bounding boxes of the objects that were detected
    • Method Detail

      • item

        public <T extends Classifications.Classification> T item​(int index)
        Returns the item at a given index based on the order used to construct the Classifications.
        Overrides:
        item in class Classifications
        Type Parameters:
        T - the type of classification item for the task
        Parameters:
        index - the index of the item to return
        Returns:
        the item at the given index, equivalent to classifications.items().get(index)
      • getNumberOfObjects

        public int getNumberOfObjects()
        Returns the number of objects found in an image.
        Returns:
        the number of objects found in an image
      • toJson

        public java.lang.String toJson()
        Specified by:
        toJson in interface ai.djl.util.JsonSerializable
        Overrides:
        toJson in class Classifications