Class FaceAnnotation (3.3.0)

publicfinalclass FaceAnnotationextendsGeneratedMessageV3implementsFaceAnnotationOrBuilder

A face annotation object contains the results of face detection.

Protobuf type google.cloud.vision.v1.FaceAnnotation

Inherited Members

Static Fields

ANGER_LIKELIHOOD_FIELD_NUMBER

publicstaticfinalintANGER_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

BLURRED_LIKELIHOOD_FIELD_NUMBER

publicstaticfinalintBLURRED_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

BOUNDING_POLY_FIELD_NUMBER

publicstaticfinalintBOUNDING_POLY_FIELD_NUMBER
Field Value
Type Description
int

DETECTION_CONFIDENCE_FIELD_NUMBER

publicstaticfinalintDETECTION_CONFIDENCE_FIELD_NUMBER
Field Value
Type Description
int

FD_BOUNDING_POLY_FIELD_NUMBER

publicstaticfinalintFD_BOUNDING_POLY_FIELD_NUMBER
Field Value
Type Description
int

HEADWEAR_LIKELIHOOD_FIELD_NUMBER

publicstaticfinalintHEADWEAR_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

JOY_LIKELIHOOD_FIELD_NUMBER

publicstaticfinalintJOY_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

LANDMARKING_CONFIDENCE_FIELD_NUMBER

publicstaticfinalintLANDMARKING_CONFIDENCE_FIELD_NUMBER
Field Value
Type Description
int

LANDMARKS_FIELD_NUMBER

publicstaticfinalintLANDMARKS_FIELD_NUMBER
Field Value
Type Description
int

PAN_ANGLE_FIELD_NUMBER

publicstaticfinalintPAN_ANGLE_FIELD_NUMBER
Field Value
Type Description
int

ROLL_ANGLE_FIELD_NUMBER

publicstaticfinalintROLL_ANGLE_FIELD_NUMBER
Field Value
Type Description
int

SORROW_LIKELIHOOD_FIELD_NUMBER

publicstaticfinalintSORROW_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

SURPRISE_LIKELIHOOD_FIELD_NUMBER

publicstaticfinalintSURPRISE_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

TILT_ANGLE_FIELD_NUMBER

publicstaticfinalintTILT_ANGLE_FIELD_NUMBER
Field Value
Type Description
int

UNDER_EXPOSED_LIKELIHOOD_FIELD_NUMBER

publicstaticfinalintUNDER_EXPOSED_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticFaceAnnotationgetDefaultInstance()
Returns
Type Description

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description

newBuilder()

publicstaticFaceAnnotation.BuildernewBuilder()
Returns
Type Description

newBuilder(FaceAnnotation prototype)

publicstaticFaceAnnotation.BuildernewBuilder(FaceAnnotationprototype)
Parameter
Name Description
prototype FaceAnnotation
Returns
Type Description

parseDelimitedFrom(InputStream input)

publicstaticFaceAnnotationparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Exceptions
Type Description

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticFaceAnnotationparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(byte[] data)

publicstaticFaceAnnotationparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Exceptions
Type Description

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticFaceAnnotationparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteString data)

publicstaticFaceAnnotationparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticFaceAnnotationparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(CodedInputStream input)

publicstaticFaceAnnotationparseFrom(CodedInputStreaminput)
Parameter
Name Description
Returns
Type Description
Exceptions
Type Description

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticFaceAnnotationparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(InputStream input)

publicstaticFaceAnnotationparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Exceptions
Type Description

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticFaceAnnotationparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteBuffer data)

publicstaticFaceAnnotationparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticFaceAnnotationparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parser()

publicstaticParser<FaceAnnotation>parser()
Returns
Type Description

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
Overrides

getAngerLikelihood()

publicLikelihoodgetAngerLikelihood()

Anger likelihood.

.google.cloud.vision.v1.Likelihood anger_likelihood = 11;

Returns
Type Description
Likelihood

The angerLikelihood.

getAngerLikelihoodValue()

publicintgetAngerLikelihoodValue()

Anger likelihood.

.google.cloud.vision.v1.Likelihood anger_likelihood = 11;

Returns
Type Description
int

The enum numeric value on the wire for angerLikelihood.

getBlurredLikelihood()

publicLikelihoodgetBlurredLikelihood()

Blurred likelihood.

.google.cloud.vision.v1.Likelihood blurred_likelihood = 14;

Returns
Type Description
Likelihood

The blurredLikelihood.

getBlurredLikelihoodValue()

publicintgetBlurredLikelihoodValue()

Blurred likelihood.

.google.cloud.vision.v1.Likelihood blurred_likelihood = 14;

Returns
Type Description
int

The enum numeric value on the wire for blurredLikelihood.

getBoundingPoly()

publicBoundingPolygetBoundingPoly()

The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale. The bounding box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated in the BoundingPoly (the polygon will be unbounded) if only a partial face appears in the image to be annotated.

.google.cloud.vision.v1.BoundingPoly bounding_poly = 1;

Returns
Type Description
BoundingPoly

The boundingPoly.

getBoundingPolyOrBuilder()

publicBoundingPolyOrBuildergetBoundingPolyOrBuilder()

The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale. The bounding box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated in the BoundingPoly (the polygon will be unbounded) if only a partial face appears in the image to be annotated.

.google.cloud.vision.v1.BoundingPoly bounding_poly = 1;

Returns
Type Description

getDefaultInstanceForType()

publicFaceAnnotationgetDefaultInstanceForType()
Returns
Type Description

getDetectionConfidence()

publicfloatgetDetectionConfidence()

Detection confidence. Range [0, 1].

float detection_confidence = 7;

Returns
Type Description
float

The detectionConfidence.

getFdBoundingPoly()

publicBoundingPolygetFdBoundingPoly()

The fd_bounding_poly bounding polygon is tighter than the boundingPoly, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that detects the "amount of skin" visible in an image. It is not based on the landmarker results, only on the initial face detection, hence the <code>fd</code> (face detection) prefix.

.google.cloud.vision.v1.BoundingPoly fd_bounding_poly = 2;

Returns
Type Description
BoundingPoly

The fdBoundingPoly.

getFdBoundingPolyOrBuilder()

publicBoundingPolyOrBuildergetFdBoundingPolyOrBuilder()

The fd_bounding_poly bounding polygon is tighter than the boundingPoly, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that detects the "amount of skin" visible in an image. It is not based on the landmarker results, only on the initial face detection, hence the <code>fd</code> (face detection) prefix.

.google.cloud.vision.v1.BoundingPoly fd_bounding_poly = 2;

Returns
Type Description

getHeadwearLikelihood()

publicLikelihoodgetHeadwearLikelihood()

Headwear likelihood.

.google.cloud.vision.v1.Likelihood headwear_likelihood = 15;

Returns
Type Description
Likelihood

The headwearLikelihood.

getHeadwearLikelihoodValue()

publicintgetHeadwearLikelihoodValue()

Headwear likelihood.

.google.cloud.vision.v1.Likelihood headwear_likelihood = 15;

Returns
Type Description
int

The enum numeric value on the wire for headwearLikelihood.

getJoyLikelihood()

publicLikelihoodgetJoyLikelihood()

Joy likelihood.

.google.cloud.vision.v1.Likelihood joy_likelihood = 9;

Returns
Type Description
Likelihood

The joyLikelihood.

getJoyLikelihoodValue()

publicintgetJoyLikelihoodValue()

Joy likelihood.

.google.cloud.vision.v1.Likelihood joy_likelihood = 9;

Returns
Type Description
int

The enum numeric value on the wire for joyLikelihood.

getLandmarkingConfidence()

publicfloatgetLandmarkingConfidence()

Face landmarking confidence. Range [0, 1].

float landmarking_confidence = 8;

Returns
Type Description
float

The landmarkingConfidence.

getLandmarks(int index)

publicFaceAnnotation.LandmarkgetLandmarks(intindex)

Detected face landmarks.

repeated .google.cloud.vision.v1.FaceAnnotation.Landmark landmarks = 3;

Parameter
Name Description
index int
Returns
Type Description

getLandmarksCount()

publicintgetLandmarksCount()

Detected face landmarks.

repeated .google.cloud.vision.v1.FaceAnnotation.Landmark landmarks = 3;

Returns
Type Description
int

getLandmarksList()

publicList<FaceAnnotation.Landmark>getLandmarksList()

Detected face landmarks.

repeated .google.cloud.vision.v1.FaceAnnotation.Landmark landmarks = 3;

Returns
Type Description

getLandmarksOrBuilder(int index)

publicFaceAnnotation.LandmarkOrBuildergetLandmarksOrBuilder(intindex)

Detected face landmarks.

repeated .google.cloud.vision.v1.FaceAnnotation.Landmark landmarks = 3;

Parameter
Name Description
index int
Returns
Type Description

getLandmarksOrBuilderList()

publicList<?extendsFaceAnnotation.LandmarkOrBuilder>getLandmarksOrBuilderList()

Detected face landmarks.

repeated .google.cloud.vision.v1.FaceAnnotation.Landmark landmarks = 3;

Returns
Type Description
List<? extends com.google.cloud.vision.v1.FaceAnnotation.LandmarkOrBuilder>

getPanAngle()

publicfloatgetPanAngle()

Yaw angle, which indicates the leftward/rightward angle that the face is pointing relative to the vertical plane perpendicular to the image. Range [-180,180].

float pan_angle = 5;

Returns
Type Description
float

The panAngle.

getParserForType()

publicParser<FaceAnnotation>getParserForType()
Returns
Type Description
Overrides

getRollAngle()

publicfloatgetRollAngle()

Roll angle, which indicates the amount of clockwise/anti-clockwise rotation of the face relative to the image vertical about the axis perpendicular to the face. Range [-180,180].

float roll_angle = 4;

Returns
Type Description
float

The rollAngle.

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getSorrowLikelihood()

publicLikelihoodgetSorrowLikelihood()

Sorrow likelihood.

.google.cloud.vision.v1.Likelihood sorrow_likelihood = 10;

Returns
Type Description
Likelihood

The sorrowLikelihood.

getSorrowLikelihoodValue()

publicintgetSorrowLikelihoodValue()

Sorrow likelihood.

.google.cloud.vision.v1.Likelihood sorrow_likelihood = 10;

Returns
Type Description
int

The enum numeric value on the wire for sorrowLikelihood.

getSurpriseLikelihood()

publicLikelihoodgetSurpriseLikelihood()

Surprise likelihood.

.google.cloud.vision.v1.Likelihood surprise_likelihood = 12;

Returns
Type Description
Likelihood

The surpriseLikelihood.

getSurpriseLikelihoodValue()

publicintgetSurpriseLikelihoodValue()

Surprise likelihood.

.google.cloud.vision.v1.Likelihood surprise_likelihood = 12;

Returns
Type Description
int

The enum numeric value on the wire for surpriseLikelihood.

getTiltAngle()

publicfloatgetTiltAngle()

Pitch angle, which indicates the upwards/downwards angle that the face is pointing relative to the image's horizontal plane. Range [-180,180].

float tilt_angle = 6;

Returns
Type Description
float

The tiltAngle.

getUnderExposedLikelihood()

publicLikelihoodgetUnderExposedLikelihood()

Under-exposed likelihood.

.google.cloud.vision.v1.Likelihood under_exposed_likelihood = 13;

Returns
Type Description
Likelihood

The underExposedLikelihood.

getUnderExposedLikelihoodValue()

publicintgetUnderExposedLikelihoodValue()

Under-exposed likelihood.

.google.cloud.vision.v1.Likelihood under_exposed_likelihood = 13;

Returns
Type Description
int

The enum numeric value on the wire for underExposedLikelihood.

getUnknownFields()

publicfinalUnknownFieldSetgetUnknownFields()
Returns
Type Description
Overrides

hasBoundingPoly()

publicbooleanhasBoundingPoly()

The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale. The bounding box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated in the BoundingPoly (the polygon will be unbounded) if only a partial face appears in the image to be annotated.

.google.cloud.vision.v1.BoundingPoly bounding_poly = 1;

Returns
Type Description
boolean

Whether the boundingPoly field is set.

hasFdBoundingPoly()

publicbooleanhasFdBoundingPoly()

The fd_bounding_poly bounding polygon is tighter than the boundingPoly, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that detects the "amount of skin" visible in an image. It is not based on the landmarker results, only on the initial face detection, hence the <code>fd</code> (face detection) prefix.

.google.cloud.vision.v1.BoundingPoly fd_bounding_poly = 2;

Returns
Type Description
boolean

Whether the fdBoundingPoly field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
Overrides

newBuilderForType()

publicFaceAnnotation.BuildernewBuilderForType()
Returns
Type Description

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedFaceAnnotation.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
Returns
Type Description
Overrides

toBuilder()

publicFaceAnnotation.BuildertoBuilder()
Returns
Type Description

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
Overrides Exceptions
Type Description

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.