Represents one detected object in the results of ERROR(/com.google.mediapipe.tasks.version.objectdetector.ObjectDetector).
Public Constructors
Public Methods
| abstract RectF | 
boundingBox()
                
                   A  ERROR(/RectF)object to represent the bounding box of the detected object. | 
| abstract List<Category> | 
categories()
                
                   A list of  Categoryobjects. | 
| static Detection | |
| static Detection | |
| static Detection | 
createFromProto(com.google.mediapipe.formats.proto.DetectionProto.Detection detectionProto)
                
                   Creates a  Detectioninstance from aERROR(/com.google.mediapipe.formats.proto.DetectionProto.Detection)protobuf message. | 
| abstract Optional<List<NormalizedKeypoint>> | 
keypoints()
                
                   An optional list of  NormalizedKeypointassociated with the detection. | 
Inherited Methods
Public Constructors
public Detection ()
Public Methods
public abstract RectF boundingBox ()
A ERROR(/RectF) object to represent the bounding box of the detected object. 
public static Detection create (List<Category> categories, RectF boundingBox, Optional<List<NormalizedKeypoint>> keypoints)
Parameters
| categories | a list of Categoryobjects that contain category name, display name,
     score, and the label index. | 
|---|---|
| boundingBox | a ERROR(/RectF)object to represent the bounding box. | 
| keypoints | an optional list of ERROR(/NormalizedKeypoints)associated with the detection. | 
public static Detection create (List<Category> categories, RectF boundingBox)
Parameters
| categories | a list of Categoryobjects that contain category name, display name,
     score, and the label index. | 
|---|---|
| boundingBox | a ERROR(/RectF)object to represent the bounding box. | 
public static Detection createFromProto (com.google.mediapipe.formats.proto.DetectionProto.Detection detectionProto)
Creates a Detection instance from a ERROR(/com.google.mediapipe.formats.proto.DetectionProto.Detection) protobuf message.
Parameters
| detectionProto | a ERROR(/com.google.mediapipe.formats.proto.DetectionProto.Detection)protobuf message. | 
|---|
public abstract Optional<List<NormalizedKeypoint>> keypoints ()
An optional list of NormalizedKeypoint associated with the detection. Keypoints
 represent interesting points related to the detection. For example, the keypoints represent the
 eyes, ear and mouth from face detection model. Or in the template matching detection, e.g.
 KNIFT, they can represent the feature points for template matching.