Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# Portrait Class

Namespace: id3.Face

## Definition

Represents a portrait.
Python

    class Portrait

Dart

    class Portrait implements Finalizable

C#

    public partial class Portrait

Java

    public class Portrait implements AutoCloseable, Serializable

Swift

    public class Portrait

C

    typedef struct id3FacePortrait *ID3_FACE_PORTRAIT;

## Usage

Python

    portraitInstance = id3face.Portrait()

Explicit destruction

    # ...
    del portraitInstance

Dart

    final portraitInstance = sdk.Portrait();
    // ...

Explicit destruction

    // ...
    portraitInstance.dispose()

C#

    using (var portraitInstance = new Portrait())
    {
       // ...
    }

Explicit destruction

    var portraitInstance = new Portrait()
    // ...
    portraitInstance.Dispose()

Java

    try (Portrait portraitInstance = new Portrait()) {
    // ...
    }

Explicit destruction

    Portrait portraitInstance = new Portrait();
    // ...
    portraitInstance.close();

Swift

    private var portraitInstance: Portrait? = nil
    portraitInstance = try Portrait()

C

    ID3_FACE_PORTRAIT hPortrait{};
    int err = id3FacePortrait_Initialize(&hPortrait);
    if (err == ID3_SUCCESS) {
        // ...
        id3FacePortrait_Dispose(&hPortrait);
    }

## Properties

Name | Type | Description
--- | --- | ---
age | int | Estimated age of the subject. -1 if not computed.
backgroundUniformity | BackgroundUniformity | Result of the background uniformity computation.
expression | FaceExpression | Estimated expression of the subject (angriness, disgust, fear, happiness, sadness, surprise, or neutral). Unknown if not computed.
eyeGaze | EyeGaze | Estimated gaze.
faceId | int | Unique face ID.
faceMask | int | Value indicating whether a face mask is detected. The range is 0-100, 100 meaning a mask is detected.
faceTemplate | FaceTemplate | Face template.
genderMale | int | Value indicating whether the subject is a male. -1 if not computed. The range is 0 (female) -100 (male).
geometricAttributes | GeometricAttributes | Geometric attributes.
glasses | int | Value indicating whether the subject wears glasses. -1 if not computed. The range is 0-100, 100 meaning glasses are detected.
hat | int | Value indicating whether the subject wears a hat. -1 if not computed. The range is 0-100, 100 meaning a hat is detected.
image | Image | Source image.
imageCenter | Point | Center of the portrait in the source image.
imageScale | float | Scale to be applied to the source image to display the portrait.
imageTranslation | Point | Translation to be applied to the source image to display the portrait.
instruction | PortraitInstruction | Instruction to be given to the user for portrait capture.
landmarks | PointList | 68-points landmarks.
leftEyeOpening | int | Value estimating the opening of the left eye. -1 if not computed. The range is 0-100, 100 meaning the eye is fully opened.
leftEyeVisibility | int | Value estimating the visibility of the left eye. -1 if not computed. The range is 0-100, 100 meaning the left eye is fully visible.
lookStraightScore | int | Value estimating if the user is looking straight towards the camera. -1 if not computed. The range is 0-100, 100 meaning the look is straight.
makeup | int | Value indicating whether makeup is detected. -1 if not computed. The range is 0-100, 100 meaning makeup is detected.
mouthOpening | int | Value indicating estimating the opening of the mouth. -1 if not computed. The range is 0-100, 100 meaning the mouth is fully open.
mouthVisibility | int | Value estimating the visibility of the mouth. -1 if not computed. The range is 0-100, 100 meaning the mouth is fully visible.
noseVisibility | int | Value estimating the visibility of the nose. -1 if not computed. The range is 0-100, 100 meaning the nose is fully visible.
padScore | int | Score of the presentation attack detection.
padStatus | PadStatus | Status of the presentation attack detection.
photographicAttributes | PhotographicAttributes | Photographic attributes.
pose | FacePose | Face pose.
qualityCheckpoints | PortraitQualityCheckpoints | Quality check points of the portrait.
qualityScore | int | Unified quality score, from 0 to 100. -1 if not computed.
rightEyeOpening | int | Value estimating the opening of the left eye. -1 if not computed. The range is 0-100, 100 meaning the eye is fully opened.
rightEyeVisibility | int | Value estimating the visibility of the right eye. -1 if not computed. The range is 0-100, 100 meaning the right eye is fully visible.
smile | int | Value indicating whether the subject is smiling. -1 if not computed. The range is 0-100, 100 meaning the person is smiling.
status | PortraitStatus | Status of the portrait.
subjectPosition | SubjectPosition | Position of the subject in the image.
trackedFace | TrackedFace | Tracked face.

## Static Methods

Name | Description
--- | ---
fromBuffer | Imports the portrait object from a buffer.

## Methods

Name | Description
--- | ---
clear | Clears all attributes.
clone | Clones the Portrait object.
toBuffer | Exports the portrait to a buffer.