Face Alignment

Align face pose using Face Pose model

Overview

Align face pose using Face Pose model

Inputs & Outputs

  • Input media: Raw Video.
  • Output media: Raw Video.
  • Output metadata: updated face rectangles and objects[].attributes[].landmarks.

Pipeline usage

Place a face detector and the Face Pose model upstream. The node processes objects labeled face and looks for a tensor layer named fc1 with dimensions [212] (106 two-dimensional landmarks). It uses selected landmarks to affine-warp each face region in the frame, keeps the face bounding rectangle, and appends a landmarks object attribute.

display_landmarks only draws landmark points and labels for debugging. Face alignment remains enabled whether this property is true or false.

Properties

PropertyDescriptionTypeDefaultRequired
pose_model_nodeSelect Face Pose model node. Accepted node type: model_inference.stringnullYes
display_landmarksDraw landmark points and their indices on the frame for debugging. Face alignment remains enabled.boolfalseNo

Output Metadata

The fields below are declared by this node's metadata schema; the JSON values are representative examples.

PathTypeDescription
objectsarrayValue of objects.
objects[].attributesarrayValue of attributes.
objects[].attributes[].class_idintegerValue of class id.
objects[].attributes[].labelstringValue of label.
objects[].attributes[].probabilitynumberValue of probability.

JSON example

{
  "objects": [
    {
      "attributes": [
        {
          "class_id": 21999,
          "label": "landmarks",
          "probability": 0.0
        }
      ],
      "class_id": 1,
      "id": 1,
      "label": "face",
      "probability": 0.9,
      "rect": {
        "height": 80,
        "left": 100,
        "top": 60,
        "width": 80
      }
    },
    {
      "attributes": [
        {
          "class_id": 21999,
          "label": "landmarks",
          "probability": 0.0
        }
      ],
      "class_id": 1,
      "id": 2,
      "label": "person",
      "probability": 0.9,
      "rect": {
        "height": 70,
        "left": 10,
        "top": 120,
        "width": 60
      }
    },
    {
      "attributes": [],
      "class_id": 1,
      "id": 3,
      "label": "face",
      "probability": 0.9,
      "rect": {
        "height": 70,
        "left": 10,
        "top": 120,
        "width": 60
      }
    }
  ]
}

Object labels and attributes

  • Object labels/classes added: None.
  • Object attribute labels/classes added: landmarks, with class 21999.

Did this page help you?