mxpi_facealignment

Function

Object alignment plugin, which can be used to align detected object images. After the object image to be aligned and the key information of the object image are input, the plugin outputs the aligned object image.

Constraints

  • Input port 0 is used to receive object image data.
  • Input port 1 is used to receive key object point data.

Plugin Base Class (Factory)

mxpi_facealignment

Input/Output

Input: buffer (data type: MxpiBuffer)

Output: buffer (data type: MxpiBuffer)

Property

For details, see Table 1.

Table 1 mxpi_facealignment plugin properties

Property Name

Description

Mandatory or Not

Modifiable or Not

deviceId

Ascend device ID, which is specified by the deviceId property in the stream_config field. You do not need to set the ID.

No

Yes

dataSourceImage

Index of the object image input data. The default value is the key value of the output port of the upstream plugin.

No

Yes

dataSourceKeyPoint

Index of the key object point input data. The default value is the key value of the output port of the upstream plugin.

No

Yes

afterFaceAlignmentHeight

Image height after object alignment. The default value is 112, and the value range is [32, 8192].

No

Yes

afterFaceAlignmentWidth

Image width after object alignment. The default value is 112, and the value range is [32, 8192].

No

Yes

Ensure that the attributes of afterFaceAlignmentHeight and afterFaceAlignmentWidth are consistent with the metadata of the input image. Otherwise, the alignment result fails to be obtained due to inconsistent parameters. In addition, the OpenCV requires that the height and width be multiples of 2.