Class Recognition
-
- All Implemented Interfaces:
public final class Recognition
Recognition class representing object recognitions during inference.
-
-
Field Summary
Fields Modifier and Type Field Description private final String
label
private final Float
confidence
private final BoundingBox
boundingBox
-
Constructor Summary
Constructors Constructor Description Recognition(String label, Float confidence)
Create a recognition from a label and confidence. Recognition(String label, Float confidence, BoundingBox boundingBox)
Create a recognition from a label, confidence, and bounding box.
-
Method Summary
Modifier and Type Method Description final String
getLabel()
Retrieves the label of this recognition. final Float
getConfidence()
Retrieves the confidence of this recognition. final BoundingBox
getBoundingBox()
final Optional<BoundingBox>
getBoundingBox()
Retrieves the bounding box associated with this recognition. String
toString()
{@inheritDoc} -
-
Constructor Detail
-
Recognition
Recognition(String label, Float confidence)
Create a recognition from a label and confidence.- Parameters:
label
- the label of the object being recognisedconfidence
- the confidence of the object recognition
-
Recognition
Recognition(String label, Float confidence, BoundingBox boundingBox)
Create a recognition from a label, confidence, and bounding box.- Parameters:
label
- the label of the object being recognisedconfidence
- the confidence of the object recognitionboundingBox
- the bounds of the object in the image
-
-
Method Detail
-
getLabel
final String getLabel()
Retrieves the label of this recognition.
- Returns:
a String label value.
-
getConfidence
final Float getConfidence()
Retrieves the confidence of this recognition.
- Returns:
a float confidence value.
-
getBoundingBox
final BoundingBox getBoundingBox()
-
getBoundingBox
final Optional<BoundingBox> getBoundingBox()
Retrieves the bounding box associated with this recognition.
- Returns:
an optional BoundingBox.
-
-
-
-