Class FaceAnnotation (3.42.0)

public final class FaceAnnotation extends GeneratedMessageV3 implements FaceAnnotationOrBuilder

A face annotation object contains the results of face detection.

Protobuf type google.cloud.vision.v1p2beta1.FaceAnnotation

Static Fields

ANGER_LIKELIHOOD_FIELD_NUMBER

public static final int ANGER_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

BLURRED_LIKELIHOOD_FIELD_NUMBER

public static final int BLURRED_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

BOUNDING_POLY_FIELD_NUMBER

public static final int BOUNDING_POLY_FIELD_NUMBER
Field Value
Type Description
int

DETECTION_CONFIDENCE_FIELD_NUMBER

public static final int DETECTION_CONFIDENCE_FIELD_NUMBER
Field Value
Type Description
int

FD_BOUNDING_POLY_FIELD_NUMBER

public static final int FD_BOUNDING_POLY_FIELD_NUMBER
Field Value
Type Description
int

HEADWEAR_LIKELIHOOD_FIELD_NUMBER

public static final int HEADWEAR_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

JOY_LIKELIHOOD_FIELD_NUMBER

public static final int JOY_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

LANDMARKING_CONFIDENCE_FIELD_NUMBER

public static final int LANDMARKING_CONFIDENCE_FIELD_NUMBER
Field Value
Type Description
int

LANDMARKS_FIELD_NUMBER

public static final int LANDMARKS_FIELD_NUMBER
Field Value
Type Description
int

PAN_ANGLE_FIELD_NUMBER

public static final int PAN_ANGLE_FIELD_NUMBER
Field Value
Type Description
int

ROLL_ANGLE_FIELD_NUMBER

public static final int ROLL_ANGLE_FIELD_NUMBER
Field Value
Type Description
int

SORROW_LIKELIHOOD_FIELD_NUMBER

public static final int SORROW_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

SURPRISE_LIKELIHOOD_FIELD_NUMBER

public static final int SURPRISE_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

TILT_ANGLE_FIELD_NUMBER

public static final int TILT_ANGLE_FIELD_NUMBER
Field Value
Type Description
int

UNDER_EXPOSED_LIKELIHOOD_FIELD_NUMBER

public static final int UNDER_EXPOSED_LIKELIHOOD_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static FaceAnnotation getDefaultInstance()
Returns
Type Description
FaceAnnotation

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static FaceAnnotation.Builder newBuilder()
Returns
Type Description
FaceAnnotation.Builder

newBuilder(FaceAnnotation prototype)

public static FaceAnnotation.Builder newBuilder(FaceAnnotation prototype)
Parameter
Name Description
prototype FaceAnnotation
Returns
Type Description
FaceAnnotation.Builder

parseDelimitedFrom(InputStream input)

public static FaceAnnotation parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static FaceAnnotation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static FaceAnnotation parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static FaceAnnotation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static FaceAnnotation parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static FaceAnnotation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static FaceAnnotation parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static FaceAnnotation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static FaceAnnotation parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static FaceAnnotation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static FaceAnnotation parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static FaceAnnotation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FaceAnnotation
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<FaceAnnotation> parser()
Returns
Type Description
Parser<FaceAnnotation>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAngerLikelihood()

public Likelihood getAngerLikelihood()

Anger likelihood.

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

Returns
Type Description
Likelihood

The angerLikelihood.

getAngerLikelihoodValue()

public int getAngerLikelihoodValue()

Anger likelihood.

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

Returns
Type Description
int

The enum numeric value on the wire for angerLikelihood.

getBlurredLikelihood()

public Likelihood getBlurredLikelihood()

Blurred likelihood.

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

Returns
Type Description
Likelihood

The blurredLikelihood.

getBlurredLikelihoodValue()

public int getBlurredLikelihoodValue()

Blurred likelihood.

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

Returns
Type Description
int

The enum numeric value on the wire for blurredLikelihood.

getBoundingPoly()

public BoundingPoly getBoundingPoly()

The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale, as returned in ImageParams. 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.v1p2beta1.BoundingPoly bounding_poly = 1;

Returns
Type Description
BoundingPoly

The boundingPoly.

getBoundingPolyOrBuilder()

public BoundingPolyOrBuilder getBoundingPolyOrBuilder()

The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale, as returned in ImageParams. 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.v1p2beta1.BoundingPoly bounding_poly = 1;

Returns
Type Description
BoundingPolyOrBuilder

getDefaultInstanceForType()

public FaceAnnotation getDefaultInstanceForType()
Returns
Type Description
FaceAnnotation

getDetectionConfidence()

public float getDetectionConfidence()

Detection confidence. Range [0, 1].

float detection_confidence = 7;

Returns
Type Description
float

The detectionConfidence.

getFdBoundingPoly()

public BoundingPoly getFdBoundingPoly()

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.v1p2beta1.BoundingPoly fd_bounding_poly = 2;

Returns
Type Description
BoundingPoly

The fdBoundingPoly.

getFdBoundingPolyOrBuilder()

public BoundingPolyOrBuilder getFdBoundingPolyOrBuilder()

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.v1p2beta1.BoundingPoly fd_bounding_poly = 2;

Returns
Type Description
BoundingPolyOrBuilder

getHeadwearLikelihood()

public Likelihood getHeadwearLikelihood()

Headwear likelihood.

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

Returns
Type Description
Likelihood

The headwearLikelihood.

getHeadwearLikelihoodValue()

public int getHeadwearLikelihoodValue()

Headwear likelihood.

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

Returns
Type Description
int

The enum numeric value on the wire for headwearLikelihood.

getJoyLikelihood()

public Likelihood getJoyLikelihood()

Joy likelihood.

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

Returns
Type Description
Likelihood

The joyLikelihood.

getJoyLikelihoodValue()

public int getJoyLikelihoodValue()

Joy likelihood.

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

Returns
Type Description
int

The enum numeric value on the wire for joyLikelihood.

getLandmarkingConfidence()

public float getLandmarkingConfidence()

Face landmarking confidence. Range [0, 1].

float landmarking_confidence = 8;

Returns
Type Description
float

The landmarkingConfidence.

getLandmarks(int index)

public FaceAnnotation.Landmark getLandmarks(int index)

Detected face landmarks.

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

Parameter
Name Description
index int
Returns
Type Description
FaceAnnotation.Landmark

getLandmarksCount()

public int getLandmarksCount()

Detected face landmarks.

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

Returns
Type Description
int

getLandmarksList()

public List<FaceAnnotation.Landmark> getLandmarksList()

Detected face landmarks.

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

Returns
Type Description
List<Landmark>

getLandmarksOrBuilder(int index)

public FaceAnnotation.LandmarkOrBuilder getLandmarksOrBuilder(int index)

Detected face landmarks.

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

Parameter
Name Description
index int
Returns
Type Description
FaceAnnotation.LandmarkOrBuilder

getLandmarksOrBuilderList()

public List<? extends FaceAnnotation.LandmarkOrBuilder> getLandmarksOrBuilderList()

Detected face landmarks.

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

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

getPanAngle()

public float getPanAngle()

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()

public Parser<FaceAnnotation> getParserForType()
Returns
Type Description
Parser<FaceAnnotation>
Overrides

getRollAngle()

public float getRollAngle()

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()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getSorrowLikelihood()

public Likelihood getSorrowLikelihood()

Sorrow likelihood.

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

Returns
Type Description
Likelihood

The sorrowLikelihood.

getSorrowLikelihoodValue()

public int getSorrowLikelihoodValue()

Sorrow likelihood.

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

Returns
Type Description
int

The enum numeric value on the wire for sorrowLikelihood.

getSurpriseLikelihood()

public Likelihood getSurpriseLikelihood()

Surprise likelihood.

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

Returns
Type Description
Likelihood

The surpriseLikelihood.

getSurpriseLikelihoodValue()

public int getSurpriseLikelihoodValue()

Surprise likelihood.

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

Returns
Type Description
int

The enum numeric value on the wire for surpriseLikelihood.

getTiltAngle()

public float getTiltAngle()

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()

public Likelihood getUnderExposedLikelihood()

Under-exposed likelihood.

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

Returns
Type Description
Likelihood

The underExposedLikelihood.

getUnderExposedLikelihoodValue()

public int getUnderExposedLikelihoodValue()

Under-exposed likelihood.

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

Returns
Type Description
int

The enum numeric value on the wire for underExposedLikelihood.

hasBoundingPoly()

public boolean hasBoundingPoly()

The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale, as returned in ImageParams. 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.v1p2beta1.BoundingPoly bounding_poly = 1;

Returns
Type Description
boolean

Whether the boundingPoly field is set.

hasFdBoundingPoly()

public boolean hasFdBoundingPoly()

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.v1p2beta1.BoundingPoly fd_bounding_poly = 2;

Returns
Type Description
boolean

Whether the fdBoundingPoly field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public FaceAnnotation.Builder newBuilderForType()
Returns
Type Description
FaceAnnotation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected FaceAnnotation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
FaceAnnotation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public FaceAnnotation.Builder toBuilder()
Returns
Type Description
FaceAnnotation.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException