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

# PortraitProcessor.updatePortrait Method

Module: PortraitProcessor

## Definition

Analyses an image and updates the specified portrait with the first detected face or the currently tracked face.

This method performs the following tasks:

- Face detection and tracking with prediction models

- Landmark detection (68 points)

- Head pose estimation

- Verification of subject position

- Template encoding and updating

- Geometric attributes computation

- Unified quality score computation

Important

This method requires the `FaceDetector`, `FaceEncoder`, `FaceLandmarksEstimator` and `FacePoseEstimator` models to be loaded.

Python

    update_portrait(self, portrait: Portrait, image: Image) -> None

Parameters

> `portrait` Portrait
> in The portrait to be updated.
> `image` Image
> in The source image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Dart

    void updatePortrait(Portrait portrait, Image image)

Parameters

> `portrait` Portrait
> in The portrait to be updated.
> `image` Image
> in The source image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C#

    public void UpdatePortrait(Portrait portrait, Image image)

Parameters

> `portrait` Portrait
> in The portrait to be updated.
> `image` Image
> in The source image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Java

    public void updatePortrait(Portrait portrait, Image image) throws FaceException

Parameters

> `portrait` Portrait
> in The portrait to be updated.
> `image` Image
> in The source image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Swift

    public func updatePortrait(portrait: Portrait, image: Image) throws

Parameters

> `portrait` Portrait
> in The portrait to be updated.
> `image` Image
> in The source image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C

    int id3FacePortraitProcessor_UpdatePortrait (
        ID3_FACE_PORTRAIT_PROCESSOR hPortraitProcessor,
        ID3_FACE_PORTRAIT hPortrait,
        ID3_FACE_IMAGE hImage)

Parameters

> `hPortraitProcessor` ID3_FACE_PORTRAIT_PROCESSOR
> in Handle to the PortraitProcessor object.
> `hPortrait` ID3_FACE_PORTRAIT
> in The portrait to be updated.
> `hImage` ID3_FACE_IMAGE
> in The source image.

Returns

> `int`
> An error code.
> See id3FaceError file for the list of possible error codes.