Generic Classifier
Retrieves classifier results based on the similarity of text prompts and the images of objects in a ROI, or of a ROI image contents.
Overview
The Generic Classifier node is designed to retrieve classifier results by analyzing the similarity of text prompts and the images of objects within a Region of Interest (ROI), or the contents of a ROI image. This functionality is useful for applications requiring detailed classification of objects or areas within a video feed.
Inputs & Outputs
- Inputs: 1, Media Format: Raw Video
- Outputs: 1, Media Format: Raw Video
- Output Metadata:
nodes.node_id,recognized_objs,recognized_obj_ids,recognized_obj_count,recognized_obj_delta,value_changed_delta,unrecognized_obj_count,unrecognized_obj_delta
Pipeline setup
Choose the processing mode based on what should be classified:
- ROIs, at an interval classifies each configured ROI periodically. Use this for scene state such as an occupied bay, an open door, or a blocked aisle.
- ROIs, upon a trigger classifies an ROI only when the trigger becomes true. Place the node after the metadata-producing node referenced by the trigger.
- Objects in an ROI classifies crops from objects already present in frame metadata. Place an object detector—and normally a tracker—upstream. Stable object IDs allow the lookup limits, size-change checks, and continuous mode to work as intended.
Use the resulting ROI labels or object attributes in downstream Filter, Event, notification, or storage nodes. Start with display_objinfo and debug enabled while tuning, then disable them after validating the labels and thresholds on representative footage.
Properties
| Property | Description | Type | Default | Required |
|---|---|---|---|---|
roi_labels | Regions of interest labels | string | — | No |
rois | Regions of interest. Conditional on roi_labels. Format: comma-separated normalized x,y coordinate pairs; separate multiple polygons with semicolons (for example, 0.1,0.1,0.9,0.1,0.9,0.9). | string | null | No |
processing_mode | Processing mode. Options: ROIs, at an Interval (rois_interval); ROIs, upon a Trigger (rois_trigger); Objects in an ROI (objects). | enum | rois_interval | Yes |
trigger | Queue ROI for lookup when this condition evaluates to true. Conditional on processing_mode being rois_trigger. | trigger-condition | null | No |
objects_to_process | ex. car,person,car.red. Conditional on processing_mode being objects. | model-labels | null | No |
obj_lookup_mode | Object lookup mode. Options: Until result (until_result): Lookup on interval or size change, until a result is obtained or max attempts are exhausted; Continuously (continuous): Periodically, at an interval. Conditional on processing_mode being objects. | enum | until_result | No |
tracking_mode | Tracking mode. Options: Centroid (centroid); Top center (top-center); Bottom center (bottom-center); Left center (left-center); Right center (right-center). Conditional on processing_mode being objects. | enum | centroid | No |
min_obj_size_pixels | Min. width and height of an object. Conditional on processing_mode being objects. | number | 64 | No |
obj_lookup_size_change_threshold | Object size ratio change threshold. Conditional on obj_lookup_mode being until_result. Range: minimum 0.01, maximum 2.0. Step: 0.2. | float | 0.1 | No |
max_lookups_per_obj | Max. attempts per object. Conditional on obj_lookup_mode being until_result. | number | 5 | No |
model_id | The high-specificity model rejects dissimilar matches better than the default model, but requires descriptive prompts and separately tuned thresholds. Options: Default (default); High specificity (high_specificity). | enum | default | No |
classifier_mode | Classifier mode. Options: Single (single): Assign a single class with highest likelihood above the threshold; Multi (multi): Assign multiple classes with likelihood above the threshold. | enum | single | No |
input_text | Insert a description (and optional label) for each class, each on a new line. Format: <description>=<label>[@min_similarity_threshold_override]. | string | null | No |
fallback_label | Insert an optional label to be assigned if no match is found amongst provided class descriptions. | string | null | No |
min_similarity_threshold | Only consider results above this threshold in the class description-to-image similarity. For good results, start with a minimum value and increase until you get rid of false positives. Default model ideal range 0.01-0.4, high specificity model ideal range 0.0001-0.4. Range: minimum 0, maximum 1.0. Step: 0.01. Precision: 4 decimal places. | float | 0.01 | Yes |
interval | Queue objects or ROIs for lookup at least this many seconds apart. Supports decimals, e.g. 0.5 or 0.1 seconds. Unit: seconds. | float | 1 | No |
display_roi | Display ROI on video? | bool | true | No |
display_objinfo | Display results on video? Options: Disabled (disabled); Bottom left (bottom_left); Bottom right (bottom_right); Top left (top_left); Top right (top_right). | enum | bottom_left | No |
debug | Log debugging information? | bool | false | No |
Guidelines
Model and prompt guidance
The classifier uses a SigLIP-based model to compare each visual description with the image. Similarity scores are evaluated independently for each description, so:
- Write each class as a concrete visual description of what the crop should look like—not as an instruction, keyword, metadata label, or abstract yes/no question.
- Describe competing classes at a similar level of detail and from the expected camera viewpoint.
- Prefer visible positive evidence (clothing, color, object, posture, scene state) over pure negation such as “not safe.”
- In
multimode, several descriptions can independently exceed their thresholds; the scores do not form a probability distribution that sums to one. - Tune thresholds separately for each model option. Record scores with
debug, begin permissively, then raise each threshold until false positives are rejected. A per-class@thresholdoverride is useful when one visual concept is consistently easier or harder than the others.
Each non-empty line in input_text has this form:
<visual description>=<output label>[@threshold]The output label and threshold are optional. The model only receives the description to the left of =; the label is what the node writes to metadata.
Prompt examples
| Goal | Good descriptions | Avoid | Why |
|---|---|---|---|
| Safety-vest classification | a worker wearing a bright yellow high-visibility safety vest=vesta worker wearing a dark shirt with no high-visibility garment=no_vest | vestIs this worker safe? | The good prompts describe visible, competing appearances. A bare label has little visual context, while “safe” is an abstract judgment. |
| Parking-space state | an empty marked parking space viewed by a security camera=emptya marked parking space occupied by a vehicle=occupied | not occupied | Paired descriptions give both classes comparable scene and camera context; pure negation is less visually grounded. |
| Vehicle type | a passenger sedan viewed from the [email protected]a delivery van viewed from the [email protected] | classify the vehicle | The good prompts name observable body styles and demonstrate per-class threshold overrides. The avoided prompt is an instruction, not a class description. |
| Multiple independent attributes | a person wearing a hard hat=hard_hata person wearing a high-visibility vest=high_vis_vest | proper PPE | Use multi mode for attributes that can both be true. “Proper PPE” hides several visual concepts in one subjective label. |
For a first deployment, test prompts against daytime, nighttime, near/far, partially occluded, and empty-ROI examples. Include a fallback label only when downstream logic needs an explicit value for “none of the configured descriptions matched.”
Metadata
The output metadata includes detailed information about the classification results, such as the types of objects recognized, their counts, and any changes in their recognition status. This allows for a comprehensive understanding of the scene being analyzed.
Output Metadata
The fields below are declared by this node's metadata schema; the JSON values are representative examples.
| Path | Type | Description |
|---|---|---|
nodes.<node_id>.rois.<roi_label>.label_changed_delta | boolean | When the class of an ROI changes |
nodes.<node_id>.rois.<roi_label>.label_available | boolean | Boolean indicating whether the node has a current result for this ROI. |
nodes.<node_id>.rois.<roi_label>.label | string | Current model-generated result for this ROI. |
nodes.<node_id>.recognized_obj_count | integer | Number of objects successfully processed in the current frame. |
nodes.<node_id>.recognized_obj_delta | integer | When one or more new objects are classified |
nodes.<node_id>.label_changed_obj_delta | integer | When the class of one or more objects changes |
nodes.<node_id>.unrecognized_obj_count | integer | Number of objects that could not be processed in the current frame. |
nodes.<node_id>.unrecognized_obj_delta | integer | When one or more objects fail to be classified |
nodes.<node_id>.recognized_obj_ids | array | Array of tracking IDs of objects successfully processed by the node. |
nodes.<node_id>.objects_of_interest_keys | array | Array of metadata keys that contain object IDs relevant to downstream integrations. |
nodes.<node_id>.type | string | Identifies the node type that produced this metadata. |
JSON example
{
"nodes": {
"generic_classifier1": {
"label_changed_obj_delta": 0,
"objects_of_interest_keys": [],
"recognized_obj_count": 0,
"recognized_obj_delta": 0,
"recognized_obj_ids": [],
"rois": {
"roi1": {
"label": "example",
"label_available": false,
"label_changed_delta": false
}
},
"type": "generic_classifier",
"unrecognized_obj_count": 0,
"unrecognized_obj_delta": 0
}
}
}Object labels and attributes
- Object labels/classes added: In ROI mode, the configured ROI label is added as an object with class
10800. - Object attribute labels/classes added: ROI objects receive
generic_classifier_roi(10800); matched configured output labels, or the configured fallback label, use class10801on ROI or upstream objects.
Updated 4 days ago
