FirebaseVisionFace

public class FirebaseVisionFace extends Object

This class is deprecated.
The standalone ML Kit SDK replaces this API. For more information, refer to the migration guide.

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.
FirebaseVisionFaceContour
getContour(int contourType)
Gets contour based on the provided FirebaseVisionFaceContour.ContourType type.
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.LandmarkType 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.
String

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 FirebaseVisionFaceContour getContour (int contourType)

Gets contour based on the provided FirebaseVisionFaceContour.ContourType type. If the contour is not available, it would contain an empty point list.

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 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.LandmarkType 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 setClassificationMode(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 setClassificationMode(int) or the required landmarks are not found.

public int getTrackingId ()

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

public String toString ()