Age & Gender Estimation by Grip

Estimate age and gender using Grip's demographics models.

Overview

Estimate age and gender using Grip's demographics models.

Inputs & Outputs

  • Input media: Raw Video.
  • Output media: Raw Video.
  • Output metadata: objects[].attributes (age and gender).

Pipeline usage

Place a face detector and Grip demographics model upstream. This node only evaluates objects whose label is face, and expects the corresponding object tensor to contain a 12-value age/gender classification layer. A tracker is strongly recommended because estimates are cached by object ID between model inference frames.

For each recognized face, the node appends two attributes to the object:

  • A numeric age estimate with class ID 999.
  • male or female with class ID 998.

max_object_lifespan controls how long a cached estimate is reused after its object ID disappears. Use gender_bias_adjustment only after evaluating the model on representative camera placement and lighting; positive values bias toward female, while negative values bias toward male.

Properties

PropertyDescriptionTypeDefaultRequired
max_object_lifespanMax. object lifespan. Unit: seconds.float60No
gender_bias_adjustmentAdjust for gender skew introduced by environmental factors. Negative values adjust towards male, positive values adjust towards female. Range: minimum -0.5, maximum 0.5. Step: 0.05.float0.15No

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.
objects[].class_idintegerValue of class id.
objects[].idintegerValue of id.
objects[].labelstringValue of label.
objects[].probabilitynumberValue of probability.
objects[].rect.heightintegerValue of height.
objects[].rect.leftintegerValue of left.
objects[].rect.topintegerValue of top.
objects[].rect.widthintegerValue of width.

JSON example

{
  "objects": [
    {
      "attributes": [
        {
          "class_id": 999,
          "label": "20",
          "probability": 1.0
        },
        {
          "class_id": 998,
          "label": "female",
          "probability": 1.0
        }
      ],
      "class_id": 1,
      "id": 1,
      "label": "face",
      "probability": 0.9,
      "rect": {
        "height": 40,
        "left": 20,
        "top": 20,
        "width": 40
      }
    },
    {
      "attributes": [],
      "class_id": 1,
      "id": 9,
      "label": "person",
      "probability": 0.9,
      "rect": {
        "height": 120,
        "left": 10,
        "top": 10,
        "width": 60
      }
    },
    {
      "attributes": [
        {
          "class_id": 999,
          "label": "66",
          "probability": 1.0
        },
        {
          "class_id": 998,
          "label": "male",
          "probability": 1.0
        }
      ],
      "class_id": 1,
      "id": 2,
      "label": "face",
      "probability": 0.9,
      "rect": {
        "height": 40,
        "left": 20,
        "top": 20,
        "width": 40
      }
    }
  ]
}

Object labels and attributes

  • Object labels/classes added: None.
  • Object attribute labels/classes added: Estimated age values use class 999; estimated gender values use class 998.

Did this page help you?