Local Vision Language Model Lookup

Perform visual question answering on objects in an ROI, or on a ROI in the frame using local models.

Overview

The Local Vision Language Model Lookup (VLM) node performs visual question answering on objects within a Region of Interest (ROI), or on a ROI within the frame. It uses local inference with models like InternVL2-1B (small) and InternVL2-2B (large) to analyze and answer questions about image content.

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, label_changed_obj_delta

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 Interval (rois_interval); ROIs, upon Trigger (rois_trigger); Objects in an ROI (objects).enumrois_intervalYes
intervalCollect objects or ROIs for lookup atleast this many seconds apart. Unit: seconds.float10No
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_thresholdIf the size of an object changes by more than this threshold, perform a lookup. Conditional on processing_mode being objects. Range: minimum 0.01, maximum 2.0. Step: 0.2.float0.1No
max_lookups_per_objMaximum number of attempts to perform a lookup for an object in the Until result lookup mode. Conditional on processing_mode being objects.number5No
model_typeModel type. Options: InternVL3-1B (Small) (internvl3_1b): Requires Discrete GPU with at least 8 GB of memory; InternVL3-2B (Large) (internvl3_2b): Requires Discrete GPU with at least 8 GB of memory; InternVL2_5-1B (Small) (internvl2_5_1b): Requires Discrete GPU with at least 8 GB of memory; InternVL2_5-2B (Large) (internvl2_5_2b): Requires Discrete GPU with at least 8 GB of memory.enuminternvl3_1bNo
promptProvide a prompt, additional instructions or context for the model.stringnullNo
description_modeGenerate a description of the scene or objects in the images. This description will be used for search and summarization. Options: None (none); When any attribute is detected (when_attributes_present); When alert attribute is true (when_alert_present); Always describe image or object (always).enumnoneNo
attributesProvide attribute names and for each attribute, a question or description with optional answer choices to extract the attribute value. Special attributes if present: description overrides description mode, alert describes condition to trigger an alert and alert_message overrides the message to display when an alert is triggered.json{"vehicle_type": "Vehicle type: car|bus|van", "violence": "Is there any violence in the scene?", "weapons": "Is the person carrying a weapon?"}No
detail_levelMaximum image resolution. Options: Low (low); High (high).enumlowNo
max_tokensMaximum number of tokens to return for each request. Unit: tokens.number500No
max_concurrent_lookupsMaximum number of concurrent lookups. Increasing this number will increase the memory footprint of the node.number5No
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
enable_multigpuIf enabled uses all available GPUs for processing. When disabled, uses only a single GPU.boolfalseNo

Prompt Examples

Generate scene description.

Analyze the scene and provide a concise description of any unique, interesting, or noteworthy elements that would be suitable for a push notification alert. Focus on key details that capture the essence of what's happening or what's important in the image.

Attribute Examples

Providing explicit attributes lets the model return structured output that will be added as ROI or object attributes.

Each attribute is a key-value pair. Key is the attribute name, and value is the instruction for the model to extract the attribute.
The model will return the extracted attribute value as a string, which will be added as an attribute to the object/ROI.

Describe the image

{"description": "Describe the image briefly."}

Describe the image and add attributes for vehicle type and numbers

{"description": "Describe the image briefly. Return null if no vehicle is present.", "vehicle_type": "Comma separated list of vehicle types: car\|bus\|van", "vehicle_numbers": "Comma separated list of vehicle numbers"}

Add an alert flag in the metadata
{"alert": "Is this person wearing a pink shirt?"}

Publishing attributes as metrics

The Publish Metrics and Publish to BigQuery nodes can publish VLM ROI attributes. They read nodes.<vlm_node_id>.rois.<roi_label>.attributes and send one Node Metadata record or BigQuery row for each non-null attribute. For example, "vehicle_type": "car" is published as:

{
  "node_type": "vlm",
  "roi_label": "roi1",
  "node_meta": {
    "roi_label": "roi1",
    "attributes": {
      "name": "vehicle_type",
      "value": "car"
    }
  }
}

Attribute values retain their string, number, or boolean type; null values are omitted. With no explicit trigger on the publisher, the VLM's label_changed_delta fields ensure that only frames containing changed results are collected.

Model Types

InternVL2_5-1B (Small)

  • Faster inference
  • Good for basic scene description and object detection
  • Lower memory requirements
  • Default model: OpenGVLab/InternVL2_5-1B
  • Model size: 2.0 GB download
  • GPU Memory: Requires ~2.5GB of GPU memory

InternVL2_5-2B (Large)

  • More detailed and nuanced responses
  • Better understanding of complex scenes
  • Higher memory requirements
  • Default model: OpenGVLab/InternVL2_5-2B
  • Model size: 4.5 GB download
  • GPU Memory: Requires ~5.0GB of GPU memory

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 VLM result for 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>.rois.<roi_label>.attributes.<attribute_name>string, number, boolean, or nullString, number, boolean, or null produced for the configured model attribute.
nodes.<node_id>.alertbooleanWhile an alert is ongoing
nodes.<node_id>.alert_messagestringAlert message or reason for the alert
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 have VLM results
nodes.<node_id>.label_changed_obj_deltaintegerWhen the VLM result for one or more objects changes
nodes.<node_id>.recognized_obj_idsarrayArray of tracking IDs of objects successfully processed by the node.
nodes.<node_id>.unrecognized_obj_countintegerNumber of objects that could not be processed in the current frame.
nodes.<node_id>.unrecognized_obj_deltaintegerPer-frame increase in objects that could not be processed.
nodes.<node_id>.alert_obj_idsarrayArray of tracking IDs of objects associated with the current alert.
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": {
    "local_vlm1": {
      "alert": false,
      "alert_message": "value",
      "alert_obj_ids": [],
      "label_changed_obj_delta": 0,
      "objects_of_interest_keys": [],
      "recognized_obj_count": 0,
      "recognized_obj_delta": 0,
      "recognized_obj_ids": [],
      "rois": {
        "roi1": {
          "attributes": {
            "attribute_name": "value"
          },
          "label": "example",
          "label_available": false,
          "label_changed_delta": false
        }
      },
      "type": "local_vlm",
      "unrecognized_obj_count": 0,
      "unrecognized_obj_delta": 0
    }
  }
}

Object labels and attributes

  • Object labels/classes added: ROI mode adds the configured ROI label with class 10600. Object extraction adds model-returned labels, falling back to vlm_object, with class 9998.
  • Object attribute labels/classes added: ROI objects receive lvm_roi (10600); configured response values use 10602; extracted objects receive vlm_extracted (9998); successful results add vlm_results (10601).
{
  "objects": [{
    "id": 2775161862,
    "source_node_id": null,
    "model_id": null,
    "label": "roi2",
    "class_id": 10600,
    "rect": {
        "left": 128,
        "top": 72,
        "width": 512,
        "height": 575
    },
    "probability": 1.0,
    "attributes": [{
        "label": "unblocked",
        "class_id": 10602,
        "probability": 1.0
    }, {
        "label": "lvm_results",
        "class_id": 10601,
        "probability": 1.0
    }, {
        "label": "lvm_roi",
        "class_id": 10600,
        "probability": 1.0
    }],
    "corr_id": "75f5141e-020a-4f27-af26-cf17b32c2544"
  }]
}

Did this page help you?