Presence Monitor

Extracts occupancy information for objects present in a specified region of interest.

Overview

The Presence Monitor node tracks how long each detected, tracked object has been present in the specified region in the video, can highlight objects and generate max time/occupancy level alarms, and adds the presence metadata to the frame metadata. It is designed for monitoring use cases.

This node generates presence metrics: current occupancy, objects above max time threshold, occupancy above/below max thresholds.

This node requires a AI Model Node and a Track Objects Node before it in order to function properly.

This node is a simplified version of the Occupancy Monitor. Use the Occupancy monitor if you need to collect statistics such as wait times, people flow, etc. for dashboards, reporting and business intelligence.

Inputs & Outputs

  • Inputs : 1, Media Format : Raw Video
  • Outputs : 1, Media Format: Raw Video
  • Output Metadata : Presence Information

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
objects_to_trackex. car,person,car.red. Object types and classes to include. Leave blank to include all.model-labelsnullNo
min_presence_timeMin. time an object should be present in the ROI in order to be considered present. Unit: seconds.float1.0Yes
max_presence_timeCreate an alarm and shows an orange bounding box around object if present more than specified seconds in the ROI. Unit: seconds.floatnullNo
max_occupancy_thresholdSet a trigger when number of objects in the ROI exceeds or drops below this threshold.numbernullNo
crossing_bufferInterval during which an object will not be repeatedly counted if it leaves and reenters the ROI. Unit: seconds.float1.0Yes
object_types_to_flagFlag specific objects so you can trigger downstream events using those. Options: Currently in ROI (current); Newly entered into ROI (entry); Above max presence time in ROI (above_max_time); Upon exit from ROI (exit). Format: array of selected option values.string[]nullNo
trigger_eventsTriggers these events. Leave blank to not trigger any events. Options: Object enters ROI (enter); Object exits ROI (exit); Object above max time in ROI (max_wait); ROI below max occupancy threshold (below_max_occupancy); ROI above max occupancy threshold (above_max_occupancy); ROI contains all specified objects (all_objects_present). Format: array of selected option values.string[]nullNo
event_templateTemplate for enter/exit/max_wait events. Leave blank to use defaults. Available variables: {object_type}, {object_attributes}, {state}, {roi}.stringnullNo
add_object_attributesAdd specified labels as attributes to objects that interact with the ROI. ROI States include enter/exit/max wait. Options: None (none); State (enter/exit/max_wait) (state); ROI Name (roi); enumnoneNo
display_roiDisplay ROI?booltrueNo
display_roi_metaDisplay ROI Statistics? Options: None (none): Do not display; Basic (basic): Display Occupancy counts only.enumdetailedNo
display_objectsDisplay objects? Options: None (none): Do not display; Basic (basic): Tracking point only; Detailed (detailed): Tracking point and time.enumdetailedNo
tracking_modeTracking mode. Options: Centroid (centroid); Top center (top-center); Bottom center (bottom-center); Left center (left-center); Right center (right-center).enumcentroidNo

Events

Triggering specific events using trigger_events and event_template fields allows you to add Events to metadata. These Events can then be processed by downstream nodes to publish metrics to a Dashboard, or send notifications or trigger alarms / bookmarks.

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>.current_occupancyintegerNumber of objects currently occupying the ROI.
nodes.<node_id>.rois.<roi_label>.objects_entered_deltaintegerWhen one or more new objects enter the ROI
nodes.<node_id>.rois.<roi_label>.objects_exited_deltaintegerWhen one or more objects leave the ROI
nodes.<node_id>.rois.<roi_label>.objects_above_max_waiting_time_countintegerNumber of objects whose waiting time exceeds the configured maximum.
nodes.<node_id>.rois.<roi_label>.objects_above_max_waiting_time_deltaintegerWhen one or more objects exceeds the maximum waiting time
nodes.<node_id>.rois.<roi_label>.objects_above_max_occupancy_countintegerNumber of objects above the configured occupancy limit.
nodes.<node_id>.rois.<roi_label>.objects_below_max_occupancy_countintegerNumber of objects within the configured occupancy limit.
nodes.<node_id>.rois.<roi_label>.occupancy_above_max_threshold_deltaintegerWhen occupancy equals or exceeds Max Threshold
nodes.<node_id>.rois.<roi_label>.occupancy_below_max_threshold_deltaintegerWhen occupancy falls below Max Threshold
nodes.<node_id>.rois.<roi_label>.objects_flagged_countintegerNumber of objects currently matching this node’s alert criteria.
nodes.<node_id>.rois.<roi_label>.objects_flagged_deltaintegerWhen one or more objects is newly flagged
nodes.<node_id>.rois.<roi_label>.all_objects_presentbooleanBoolean indicating whether all configured object classes are currently present.
nodes.<node_id>.rois.<roi_label>.all_objects_present_deltabooleanWhen all specified object types are present in the ROI
nodes.<node_id>.rois.<roi_label>.all_objects_not_present_deltabooleanWhen all specified object types are not present in the ROI
nodes.<node_id>.rois.<roi_label>.coordsarrayArray of pixel coordinates defining the configured ROI or line.
nodes.<node_id>.rois.<roi_label>.objects_of_interest_keysarrayArray of metadata keys that contain object IDs relevant to downstream integrations.
nodes.<node_id>.rois.<roi_label>.objects_flaggedarrayArray of tracking IDs of objects currently matching this node’s alert criteria.
nodes.<node_id>.rois.<roi_label>.descriptionstringHuman-readable summary of the node’s current result.
nodes.<node_id>.events_deltaintegerWhen one or more Presence events are triggered
nodes.<node_id>.eventsarrayArray of event names generated by this node for the current frame.
nodes.<node_id>.typestringIdentifies the node type that produced this metadata.

JSON example

{
  "nodes": {
    "annotate_presence1": {
      "events": [],
      "events_delta": 0,
      "rois": {
        "roi1": {
          "all_objects_not_present_delta": false,
          "all_objects_present": true,
          "all_objects_present_delta": false,
          "coords": [
            [
              468,
              172
            ],
            [
              597,
              307
            ]
          ],
          "current_occupancy": 1,
          "description": "value",
          "objects_above_max_occupancy_count": 0,
          "objects_above_max_waiting_time_count": 1,
          "objects_above_max_waiting_time_delta": 0,
          "objects_below_max_occupancy_count": 0,
          "objects_entered_delta": 0,
          "objects_exited_delta": 1,
          "objects_flagged": [
            "12837198712897",
            "1231293712897612"
          ],
          "objects_flagged_count": 0,
          "objects_flagged_delta": 0,
          "objects_of_interest_keys": [],
          "occupancy_above_max_threshold_delta": 0,
          "occupancy_below_max_threshold_delta": 0
        }
      },
      "type": "annotate_presence"
    }
  }
}

Object labels and attributes

  • Object labels/classes added: No new class is created. The node can reinsert a tracked upstream object, preserving its original label and class.
  • Object attribute labels/classes added: Depending on add_object_attributes, the presence state (enter, exit, or max_wait) uses class 35101, the ROI label uses class 35102, and <ROI>_<state> uses class 35103.

Did this page help you?