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

PropertyDescriptionTypeDefaultRequired
roi_labelsRegions of interest labelsstringNo
roisRegions 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).stringnullNo
processing_modeProcessing mode. Options: ROIs, at an Interval (rois_interval); ROIs, upon a Trigger (rois_trigger); Objects in an ROI (objects).enumrois_intervalYes
triggerQueue ROI for lookup when this condition evaluates to true. Conditional on processing_mode being rois_trigger.trigger-conditionnullNo
objects_to_processex. car,person,car.red. Conditional on processing_mode being objects.model-labelsnullNo
obj_lookup_modeObject 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.enumuntil_resultNo
tracking_modeTracking 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.enumcentroidNo
min_obj_size_pixelsMin. width and height of an object. Conditional on processing_mode being objects.number64No
obj_lookup_size_change_thresholdObject size ratio change threshold. Conditional on obj_lookup_mode being until_result. Range: minimum 0.01, maximum 2.0. Step: 0.2.float0.1No
max_lookups_per_objMax. attempts per object. Conditional on obj_lookup_mode being until_result.number5No
model_idThe 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).enumdefaultNo
classifier_modeClassifier mode. Options: Single (single): Assign a single class with highest likelihood above the threshold; Multi (multi): Assign multiple classes with likelihood above the threshold.enumsingleNo
input_textInsert a description (and optional label) for each class, each on a new line. Format: <description>=<label>[@min_similarity_threshold_override].stringnullNo
fallback_labelInsert an optional label to be assigned if no match is found amongst provided class descriptions.stringnullNo
min_similarity_thresholdOnly 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.float0.01Yes
intervalQueue objects or ROIs for lookup at least this many seconds apart. Supports decimals, e.g. 0.5 or 0.1 seconds. Unit: seconds.float1No
display_roiDisplay ROI on video?booltrueNo
display_objinfoDisplay results on video? Options: Disabled (disabled); Bottom left (bottom_left); Bottom right (bottom_right); Top left (top_left); Top right (top_right).enumbottom_leftNo
debugLog debugging information?boolfalseNo

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 multi mode, 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 @threshold override 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

GoalGood descriptionsAvoidWhy
Safety-vest classificationa worker wearing a bright yellow high-visibility safety vest=vest
a worker wearing a dark shirt with no high-visibility garment=no_vest
vest
Is 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 statean empty marked parking space viewed by a security camera=empty
a marked parking space occupied by a vehicle=occupied
not occupiedPaired descriptions give both classes comparable scene and camera context; pure negation is less visually grounded.
Vehicle typea passenger sedan viewed from the [email protected]
a delivery van viewed from the [email protected]
classify the vehicleThe good prompts name observable body styles and demonstrate per-class threshold overrides. The avoided prompt is an instruction, not a class description.
Multiple independent attributesa person wearing a hard hat=hard_hat
a person wearing a high-visibility vest=high_vis_vest
proper PPEUse 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.

PathTypeDescription
nodes.<node_id>.rois.<roi_label>.label_changed_deltabooleanWhen the class of an ROI changes
nodes.<node_id>.rois.<roi_label>.label_availablebooleanBoolean indicating whether the node has a current result for this ROI.
nodes.<node_id>.rois.<roi_label>.labelstringCurrent model-generated result for this ROI.
nodes.<node_id>.recognized_obj_countintegerNumber of objects successfully processed in the current frame.
nodes.<node_id>.recognized_obj_deltaintegerWhen one or more new objects are classified
nodes.<node_id>.label_changed_obj_deltaintegerWhen the class of one or more objects changes
nodes.<node_id>.unrecognized_obj_countintegerNumber of objects that could not be processed in the current frame.
nodes.<node_id>.unrecognized_obj_deltaintegerWhen one or more objects fail to be classified
nodes.<node_id>.recognized_obj_idsarrayArray of tracking IDs of objects successfully processed by the node.
nodes.<node_id>.objects_of_interest_keysarrayArray of metadata keys that contain object IDs relevant to downstream integrations.
nodes.<node_id>.typestringIdentifies 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 class 10801 on ROI or upstream objects.

Did this page help you?