Class FaceAnnotation

  • All Implemented Interfaces:
    FaceAnnotationOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class FaceAnnotation
    extends com.google.protobuf.GeneratedMessageV3
    implements FaceAnnotationOrBuilder
     A face annotation object contains the results of face detection.
     
    Protobuf type google.cloud.vision.v1p4beta1.FaceAnnotation
    See Also:
    Serialized Form
    • Field Detail

      • BOUNDING_POLY_FIELD_NUMBER

        public static final int BOUNDING_POLY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • FD_BOUNDING_POLY_FIELD_NUMBER

        public static final int FD_BOUNDING_POLY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ROLL_ANGLE_FIELD_NUMBER

        public static final int ROLL_ANGLE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • TILT_ANGLE_FIELD_NUMBER

        public static final int TILT_ANGLE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DETECTION_CONFIDENCE_FIELD_NUMBER

        public static final int DETECTION_CONFIDENCE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • LANDMARKING_CONFIDENCE_FIELD_NUMBER

        public static final int LANDMARKING_CONFIDENCE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • JOY_LIKELIHOOD_FIELD_NUMBER

        public static final int JOY_LIKELIHOOD_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SORROW_LIKELIHOOD_FIELD_NUMBER

        public static final int SORROW_LIKELIHOOD_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ANGER_LIKELIHOOD_FIELD_NUMBER

        public static final int ANGER_LIKELIHOOD_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SURPRISE_LIKELIHOOD_FIELD_NUMBER

        public static final int SURPRISE_LIKELIHOOD_FIELD_NUMBER
        See Also:
        Constant Field Values
      • UNDER_EXPOSED_LIKELIHOOD_FIELD_NUMBER

        public static final int UNDER_EXPOSED_LIKELIHOOD_FIELD_NUMBER
        See Also:
        Constant Field Values
      • BLURRED_LIKELIHOOD_FIELD_NUMBER

        public static final int BLURRED_LIKELIHOOD_FIELD_NUMBER
        See Also:
        Constant Field Values
      • HEADWEAR_LIKELIHOOD_FIELD_NUMBER

        public static final int HEADWEAR_LIKELIHOOD_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RECOGNITION_RESULT_FIELD_NUMBER

        public static final int RECOGNITION_RESULT_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • hasBoundingPoly

        public boolean hasBoundingPoly()
         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.v1p4beta1.BoundingPoly bounding_poly = 1;
        Specified by:
        hasBoundingPoly in interface FaceAnnotationOrBuilder
        Returns:
        Whether the boundingPoly field is set.
      • getBoundingPoly

        public BoundingPoly getBoundingPoly()
         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.v1p4beta1.BoundingPoly bounding_poly = 1;
        Specified by:
        getBoundingPoly in interface FaceAnnotationOrBuilder
        Returns:
        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.
         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.v1p4beta1.BoundingPoly bounding_poly = 1;
        Specified by:
        getBoundingPolyOrBuilder in interface FaceAnnotationOrBuilder
      • 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.v1p4beta1.BoundingPoly fd_bounding_poly = 2;
        Specified by:
        hasFdBoundingPoly in interface FaceAnnotationOrBuilder
        Returns:
        Whether the fdBoundingPoly field is set.
      • 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.v1p4beta1.BoundingPoly fd_bounding_poly = 2;
        Specified by:
        getFdBoundingPoly in interface FaceAnnotationOrBuilder
        Returns:
        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.v1p4beta1.BoundingPoly fd_bounding_poly = 2;
        Specified by:
        getFdBoundingPolyOrBuilder in interface FaceAnnotationOrBuilder
      • getLandmarksCount

        public int getLandmarksCount()
         Detected face landmarks.
         
        repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3;
        Specified by:
        getLandmarksCount in interface FaceAnnotationOrBuilder
      • 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;
        Specified by:
        getRollAngle in interface FaceAnnotationOrBuilder
        Returns:
        The rollAngle.
      • 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;
        Specified by:
        getPanAngle in interface FaceAnnotationOrBuilder
        Returns:
        The panAngle.
      • 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;
        Specified by:
        getTiltAngle in interface FaceAnnotationOrBuilder
        Returns:
        The tiltAngle.
      • getDetectionConfidence

        public float getDetectionConfidence()
         Detection confidence. Range [0, 1].
         
        float detection_confidence = 7;
        Specified by:
        getDetectionConfidence in interface FaceAnnotationOrBuilder
        Returns:
        The detectionConfidence.
      • getLandmarkingConfidence

        public float getLandmarkingConfidence()
         Face landmarking confidence. Range [0, 1].
         
        float landmarking_confidence = 8;
        Specified by:
        getLandmarkingConfidence in interface FaceAnnotationOrBuilder
        Returns:
        The landmarkingConfidence.
      • getJoyLikelihoodValue

        public int getJoyLikelihoodValue()
         Joy likelihood.
         
        .google.cloud.vision.v1p4beta1.Likelihood joy_likelihood = 9;
        Specified by:
        getJoyLikelihoodValue in interface FaceAnnotationOrBuilder
        Returns:
        The enum numeric value on the wire for joyLikelihood.
      • getSorrowLikelihoodValue

        public int getSorrowLikelihoodValue()
         Sorrow likelihood.
         
        .google.cloud.vision.v1p4beta1.Likelihood sorrow_likelihood = 10;
        Specified by:
        getSorrowLikelihoodValue in interface FaceAnnotationOrBuilder
        Returns:
        The enum numeric value on the wire for sorrowLikelihood.
      • getAngerLikelihoodValue

        public int getAngerLikelihoodValue()
         Anger likelihood.
         
        .google.cloud.vision.v1p4beta1.Likelihood anger_likelihood = 11;
        Specified by:
        getAngerLikelihoodValue in interface FaceAnnotationOrBuilder
        Returns:
        The enum numeric value on the wire for angerLikelihood.
      • getSurpriseLikelihoodValue

        public int getSurpriseLikelihoodValue()
         Surprise likelihood.
         
        .google.cloud.vision.v1p4beta1.Likelihood surprise_likelihood = 12;
        Specified by:
        getSurpriseLikelihoodValue in interface FaceAnnotationOrBuilder
        Returns:
        The enum numeric value on the wire for surpriseLikelihood.
      • getUnderExposedLikelihoodValue

        public int getUnderExposedLikelihoodValue()
         Under-exposed likelihood.
         
        .google.cloud.vision.v1p4beta1.Likelihood under_exposed_likelihood = 13;
        Specified by:
        getUnderExposedLikelihoodValue in interface FaceAnnotationOrBuilder
        Returns:
        The enum numeric value on the wire for underExposedLikelihood.
      • getUnderExposedLikelihood

        public Likelihood getUnderExposedLikelihood()
         Under-exposed likelihood.
         
        .google.cloud.vision.v1p4beta1.Likelihood under_exposed_likelihood = 13;
        Specified by:
        getUnderExposedLikelihood in interface FaceAnnotationOrBuilder
        Returns:
        The underExposedLikelihood.
      • getBlurredLikelihoodValue

        public int getBlurredLikelihoodValue()
         Blurred likelihood.
         
        .google.cloud.vision.v1p4beta1.Likelihood blurred_likelihood = 14;
        Specified by:
        getBlurredLikelihoodValue in interface FaceAnnotationOrBuilder
        Returns:
        The enum numeric value on the wire for blurredLikelihood.
      • getHeadwearLikelihoodValue

        public int getHeadwearLikelihoodValue()
         Headwear likelihood.
         
        .google.cloud.vision.v1p4beta1.Likelihood headwear_likelihood = 15;
        Specified by:
        getHeadwearLikelihoodValue in interface FaceAnnotationOrBuilder
        Returns:
        The enum numeric value on the wire for headwearLikelihood.
      • getRecognitionResultList

        public List<FaceRecognitionResult> getRecognitionResultList()
         Additional recognition information. Only computed if
         image_context.face_recognition_params is provided, **and** a match is found
         to a [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] in the input
         [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. This field is
         sorted in order of decreasing confidence values.
         
        repeated .google.cloud.vision.v1p4beta1.FaceRecognitionResult recognition_result = 16;
        Specified by:
        getRecognitionResultList in interface FaceAnnotationOrBuilder
      • getRecognitionResultOrBuilderList

        public List<? extends FaceRecognitionResultOrBuilder> getRecognitionResultOrBuilderList()
         Additional recognition information. Only computed if
         image_context.face_recognition_params is provided, **and** a match is found
         to a [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] in the input
         [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. This field is
         sorted in order of decreasing confidence values.
         
        repeated .google.cloud.vision.v1p4beta1.FaceRecognitionResult recognition_result = 16;
        Specified by:
        getRecognitionResultOrBuilderList in interface FaceAnnotationOrBuilder
      • getRecognitionResultCount

        public int getRecognitionResultCount()
         Additional recognition information. Only computed if
         image_context.face_recognition_params is provided, **and** a match is found
         to a [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] in the input
         [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. This field is
         sorted in order of decreasing confidence values.
         
        repeated .google.cloud.vision.v1p4beta1.FaceRecognitionResult recognition_result = 16;
        Specified by:
        getRecognitionResultCount in interface FaceAnnotationOrBuilder
      • getRecognitionResult

        public FaceRecognitionResult getRecognitionResult​(int index)
         Additional recognition information. Only computed if
         image_context.face_recognition_params is provided, **and** a match is found
         to a [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] in the input
         [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. This field is
         sorted in order of decreasing confidence values.
         
        repeated .google.cloud.vision.v1p4beta1.FaceRecognitionResult recognition_result = 16;
        Specified by:
        getRecognitionResult in interface FaceAnnotationOrBuilder
      • getRecognitionResultOrBuilder

        public FaceRecognitionResultOrBuilder getRecognitionResultOrBuilder​(int index)
         Additional recognition information. Only computed if
         image_context.face_recognition_params is provided, **and** a match is found
         to a [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] in the input
         [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. This field is
         sorted in order of decreasing confidence values.
         
        repeated .google.cloud.vision.v1p4beta1.FaceRecognitionResult recognition_result = 16;
        Specified by:
        getRecognitionResultOrBuilder in interface FaceAnnotationOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static FaceAnnotation parseFrom​(ByteBuffer data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FaceAnnotation parseFrom​(ByteBuffer data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FaceAnnotation parseFrom​(com.google.protobuf.ByteString data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FaceAnnotation parseFrom​(com.google.protobuf.ByteString data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FaceAnnotation parseFrom​(byte[] data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FaceAnnotation parseFrom​(byte[] data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FaceAnnotation parseFrom​(com.google.protobuf.CodedInputStream input,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws IOException
        Throws:
        IOException
      • newBuilderForType

        public FaceAnnotation.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public FaceAnnotation.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected FaceAnnotation.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static FaceAnnotation getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<FaceAnnotation> parser()
      • getParserForType

        public com.google.protobuf.Parser<FaceAnnotation> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public FaceAnnotation getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder