Modify and Merge Objects
Merges and modifies objects, changes object bbox sizes & attributes, and allows rename and grouping of class names
Overview
This node can be used if you want to merge bounding boxes of objects of the same class, or rename one or more object classes into a specific class, or modify the object's attributes'.
Requires a AI Model Node before it in order to function properly. Having a Track Objects Node before is required if using Object Match Patterns else you can place it after the Merge Objects node.
Inputs & Outputs
- Inputs : 1, Media Format : Raw Video
- Outputs : 1, Media Format: Raw Video
- Output Metadata : Filtered Objects Information
Properties
| Property | Description | Type | Default | Required |
|---|---|---|---|---|
object_types | If specified, only process objects of these types. Leave blank to process all objects. | model-labels | null | No |
object_match_patterns | Only modify objects with IDs specified in the metadata attribute(s) defined by this pattern. Requires tracker prior to this node. Format: comma-separated metadata paths or patterns. | string | null | No |
processing_mode | Object processing mode. Options: Continuous (continuous): Process objects continuously after they match type/patterns specified atleast once; Matched (matched): Process objects only when they match the type/patterns specified. | enum | matched | No |
min_presence_secs | Only process objects/attributes that have been seen for at least this duration. Conditional on processing_mode being continuous. Unit: seconds. | float | 0 | No |
rename_objects_to | Rename object types specified using object types above. If object types are specified, number of renamed objects must match number of object types. | string | null | No |
add_object_attributes | Format: <attribute> or <attribute>=<class_id>. Ex. wrong_way,object_of_interest=6700. Add the specified attributes to the object, keeping any attributes it already has. | string | null | No |
convert_missing_attributes | If enabled, convert any specified missing attributes (person.-mask) to a negative attribute (person.no_mask). | bool | false | No |
remove_object_attributes | Format: <attribute>. Ex. wrong_way,object_of_interest. Remove the specified attributes from the object. | string | null | No |
keep_only_attributes | Format: <attribute>. Ex. mask,helmet. Keep only these attributes on the object if they are already present, and remove all others. Does not add new attributes. | string | null | No |
replace_object_attributes | Format: <attribute> or <attribute>=<class_id>. Ex. wrong_way,object_of_interest=6700. Replace all the object attributes with the ones specified. | string | null | No |
scale_factor | Grows/shrinks the bounding box of the objects by this factor. Does not resize the object itself. Range: minimum 0, maximum 10.0. Step: 0.1. Unit: x (times). | float | 1.0 | No |
overlap_threshold | Merges all overlapping objects with overlap ratio (Intersection over Union (IoU)) above this threshold. Range: minimum 0, maximum 1.0. Step: 0.05. Unit: %. | float | null | No |
display_objects | If enabled, objects removed as a result of the merge will be drawn on video for debug purposes. | bool | false | No |
object_history_duration | Remember objects for this duration after they are last seen in case they reappear. Unit: seconds. | float | 600 | No |
Intersection over Union (IoU)
IoU (Intersection over Union) is the area of overlap between two detection bounding boxes divided by the area of union of both.


Output Metadata
The fields below are declared by this node's metadata schema; the JSON values are representative examples.
| Path | Type | Description |
|---|---|---|
objects | array | Value of objects. |
objects[].attributes | array | Value of attributes. |
objects[].attributes[].class_id | integer | Value of class id. |
objects[].attributes[].label | string | Value of label. |
objects[].attributes[].probability | number | Value of probability. |
objects[].class_id | integer | Value of class id. |
objects[].id | integer | Value of id. |
objects[].label | string | Value of label. |
objects[].probability | number | Value of probability. |
objects[].rect.height | integer | Value of height. |
objects[].rect.left | integer | Value of left. |
objects[].rect.top | integer | Value of top. |
objects[].rect.width | integer | Value of width. |
JSON example
{
"objects": [
{
"attributes": [
{
"class_id": 0,
"label": "example",
"probability": 0.9
}
],
"class_id": 0,
"id": 1,
"label": "person",
"probability": 0.95,
"rect": {
"height": 320,
"left": 120,
"top": 80,
"width": 160
}
}
]
}Additional details
Object labels and attributes
- Object labels/classes added:
rename_objects_tocan replace an upstream object's label with a configured label; the upstream class ID is retained. - Object attribute labels/classes added: Configured add/replace labels use their configured class ID, or
45000when omitted. Missing required attributes can addno_<attribute>with class45000.
Updated 7 days ago
Did this page help you?
