FirebaseVisionFace

public class FirebaseVisionFace extends Object

Represents a face detected by FirebaseVisionFaceDetector.

Constant Summary

int INVALID_ID Invalid tracking ID.
float UNCOMPUTED_PROBABILITY Default value for certain face features.

Public Method Summary

Rect
getBoundingBox()
Returns the axis-aligned bounding rectangle of the detected face.
float
getHeadEulerAngleY()
Returns the rotation of the face about the vertical axis of the image.
float
getHeadEulerAngleZ()
Returns the rotation of the face about the axis pointing out of the image.
FirebaseVisionFaceLandmark
getLandmark(int landmarkType)
Gets landmark based on the provided FirebaseVisionFaceLandmark.FaceLandmark type.
float
getLeftEyeOpenProbability()
Returns a value between 0.0 and 1.0 giving a probability that the face's left eye is open.
float
getRightEyeOpenProbability()
Returns a value between 0.0 and 1.0 giving a probability that the face's right eye is open.
float
getSmilingProbability()
Returns a value between 0.0 and 1.0 giving a probability that the face is smiling.
int
getTrackingId()
Returns the tracking ID if the tracking is enabled.

Inherited Method Summary

Constants

public static final int INVALID_ID

Invalid tracking ID.

Constant Value: -1

public static final float UNCOMPUTED_PROBABILITY

Constant Value: -1.0

Public Methods

public Rect getBoundingBox ()

Returns the axis-aligned bounding rectangle of the detected face.

public float getHeadEulerAngleY ()

Returns the rotation of the face about the vertical axis of the image. Positive euler y is when the face turns toward the right side of the of the image that is being processed.

Returns
  • the rotation of the face about the vertical axis of the image

public float getHeadEulerAngleZ ()

Returns the rotation of the face about the axis pointing out of the image. Positive euler z is a counter-clockwise rotation within the image plane.

public FirebaseVisionFaceLandmark getLandmark (int landmarkType)

Gets landmark based on the provided FirebaseVisionFaceLandmark.FaceLandmark type. it returns null if the landmark type is not available.

public float getLeftEyeOpenProbability ()

Returns a value between 0.0 and 1.0 giving a probability that the face's left eye is open. Otherwise, return UNCOMPUTED_PROBABILITY

This returns UNCOMPUTED_PROBABILITY if the probability was not computed. The probability is not computed if eye open classification is not enabled via setClassificationType(int) or the feature is not available.

public float getRightEyeOpenProbability ()

Returns a value between 0.0 and 1.0 giving a probability that the face's right eye is open. Otherwise, return UNCOMPUTED_PROBABILITY

See also getLeftEyeOpenProbability().

public float getSmilingProbability ()

Returns a value between 0.0 and 1.0 giving a probability that the face is smiling. Otherwise, return UNCOMPUTED_PROBABILITY

This returns UNCOMPUTED_PROBABILITY if the probability was not computed. The probability is not computed if smile classification is not enabled via setClassificationType(int) or the required landmarks are not found.

public int getTrackingId ()

Returns the tracking ID if the tracking is enabled. Otherwise, returns INVALID_ID;

Send feedback about...

Need help? Visit our support page.