Object Detection and Classification - Object Detection and Classification - 6.3 English - XD056

Vitis Video Analytics SDK (VVAS) 6.3 User Guide (XD056)

Document_ID
XD056
Release_Date
2026-09-24
Version
6.3 English

The following example shows a JSON configuration for object detection and classification models.

{
  "config": {
    "display-level": -1,
    "font-size" : 0.5,
    "font" : 3,
    "thickness" : 2,
    "radius": 5,
    "mask-level" : 0,
    "y-offset" : 0,
    "label-color" : [
          {"level": 1, "blue" : 255, "green" : 0, "red" : 0 },
          {"level": 2, "blue" : 0, "green" : 255, "red" : 0 },
          {"level": 3, "blue" : 0, "green" : 0, "red" : 255 }
    ],
    "label-filter" : [ "class", "probability" ],
    "classes" : [
      {
        "name" : "car",
        "blue" : 255,
        "green" : 0,
        "red"  : 0,
        "masking"  : 0
      },
      {
        "name" : "person",
        "blue" : 0,
        "green" : 255,
        "red"  : 0,
        "masking"  : 0
      },
      {
        "name" : "bus",
        "blue" : 0,
        "green" : 0,
        "red"  : 255,
        "masking"  : 0
      },
      {
        "name" : "bicycle",
        "blue" : 0,
        "green" : 0,
        "red"  : 255,
        "masking"  : 0
      }
    ]
  }
}

Various configuration parameters passed to vvas_xmetaconvert via a JSON file are described in the following table.

Table 18 vvas_xmetaconvert Parameters (Object Detection and Classification)

Parameter

Expected Values

Description

font

0 to 7

The following is the list of text font values and descriptions.

  • 0: Hershey Simplex (default)

  • 1: Hershey Plain

  • 2: Hershey Duplex

  • 3: Hershey Complex

  • 4: Hershey Triplex

  • 5: Hershey Complex Small

  • 6: Hershey Script Simplex

  • 7: Hershey Script Complex

font-size

0.5 to 1

Font fraction scale factor that is multiplied by the font-specific base size. The default value is 0.5.

thickness

Integer 1 to 3

The thickness of the line that makes up the rectangle. Negative values like -1 signify that the function draws a filled rectangle. The recommended value is between 1 and 3. The default line thickness value is 1.

mask-level

Integer (0 or 1)

For a cascaded ML pipeline, you can use this field to mask out the results of a particular level in the inference results tree. All bounding boxes in that level will be masked with a black color. When set to 0 (default), none of the levels are masked. The value should be 0 or 1.

label-color

{“level”:1,
“blue”:255,
“green”:0,
“red”:0}
Level 0 to N
0 => all levels
N => specific level
blue => 0 to 255
green => 0 to 255
red => 0 to 255

Using this field, you can assign the bounding box and label color to a particular level in the inference results tree. You need to pass it as an array with the level, blue, green, and red parameters. All parameters of the array are mandatory to parse. For instance, if you want to change the color for level 2, then it will be {“level”: 2, “blue”: 0, “green”: 255, “red”: 0}.

If label-color is not parsed, then it will take the default colors. The default color scheme will be as follows:

  • level 1 => blue

  • level 2 => green

  • level 3 => red

  • all other levels => aqua

Label and bounding box color will affect with the following precedence order:

  • 1: Color parsed in classes object. For example, if you parse classes as car, then the color will be considered from the classes field.

  • 2: Color parsed in a particular level in a label-color array.

  • 3: If 0 level parsed, then all levels will be affected.

  • 4: If none of these options are defined, then the default color from the code is used.

label-filter

Array [“class”, “probability”]

This field controls what should be displayed in the label string. The addition of “class” in the array adds the ML classification name (for example, car, person, and so on). The addition of “probability” in the array adds the probability of a positive object identification.

y-offset

Integer 0 to height

‘y’ offset to be added along the height for the label in case of the classification model.

classes

{“name”:”car”,
“blue”:255,
“green”:0,
“red”:0,
“masking”:0}

This is a filtering option when using the vvas_xoverlay. The bounding box is only drawn for the classes that are listed in this configuration, and other classes are ignored. For instance, if “car”, “person”, “bicycle” are entered under “classes”, then the bounding box is only drawn for these three classes, and other classes like horse or motorbike are ignored.

The expected value column shows an example of how each class should be described. All objects in this example, by class, are using the color combination listed.

The class names in this list must match the class names assigned by vvas_xdpuinfer. Otherwise, the bounding box is not drawn.

The “masking” flag can be used to mask all objects of a class. Set it to 1 for enabling masking. This flag will override the “mask_level” field.

For instance, if “mask_level” is set to 1 and “masking” for “car” is set to 1, and if level 1 has cars and buses, then only cars are masked, not the entire level.

For face detection, keep the “classes” array empty.

display-level

Integer 0 to N
-1 => Display information at all the levels
0 => Do not display anything
N => Specific level

Display the bounding box of one particular level or all levels. The default is set to -1.

draw_above_bbox
_flag

True/False

A label will be displayed on the top of the bounding box if set to True. The default value is True.

radius

Integer

Represents the radius of the circle, also used for a point. The default value is 3.