Occupancy Monitor

Extracts queue, dwell and occupancy information based in how long detected objects have been present in a specified region in the video

Overview

The Occupancy Monitor (previously known as Queue Length Counter) node keeps track of the number and how long each detected, tracked object has been present in the specified region in the video, can highlight objects and generate max time alarms, and adds the queue analytics metadata to the frame metadata.

This node generates diverse queue metrics: the total number of objects served, the minimum and maximum queue size, the number of objects that waited on queue more than a pre-specified time (so-called alarms), the minimum, maximum and mean waiting time, etc.

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

Inputs & Outputs

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

Properties

PropertyDescriptionTypeDefaultRequired
roi_labelsComma separated list of labels for each ROI. Ex queue_entrance, poslistnullYes
roisSemicolon separated Regions of interest in the video within which objects will be tracked. Must correspond to labels defined in roi_labels. Format: R1x1,R1y1,R1x2,R1y2,R1x3,R1y3; R2x1,R2y1,R2x2,R2y2,R2x3,R2y3 \n \nEx: 10,10,100,100,100,100; 200,200,300,300,300,300polygonnullYes
objects_to_trackObject types and classes to include. Accepts object labels defined in the AI model (e.g. 'car', 'person') and classifier attributes (e.g. 'car.red'). Leave blank to include all.model-labelnullNo
min_queue_activation_timeMin. time (seconds) an object should be present in the ROI in order to be considered on queue analytics.float1.0Yes
presence_thresholdCreate an alarm and shows an orange bounding box around object if present more than specified seconds in the ROI.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.float1.0Yes
display_roiControls whether ROI information will be displayed on the video stream.booltrueNo
display_roi_metaControls display of ROI statistics. Options: none (Do not display), basic (Display Occupancy counts only), detailed (Display all ROI statistics).enum"detailed"No
display_objectsControls object display. Options: none (Do not display), basic (Tracking point only), detailed (Tracking point and time).enum"detailed"No
tracking_modePoint on object used to determine presence in ROI. Options: centroid, top-center, bottom-center, left-center, right-center.enum"centroid"No
average_wait_modeMethod for calculating average wait time. Options: moving (Average of last N exited objects), cumulative (Average of all exited objects), current (Average of current objects).enum"moving"No
average_wait_last_nNumber of last exited objects to average over in moving average mode. Min value: 1.number10No
add_object_attributesAdd specified labels as attributes to objects that interact with the ROI. Options: none, state (enter/exit/maxwait), roi (adds ROI label), roi_state (Format: `<roi_label>`).enum"none"No
persistent_storageIf true, analytics will be persisted to disk and restored when pipeline restarts.boolfalseNo

Metadata

Metadata PropertyDescription
nodes.<node_id>Describes the Queue ROIs monitored by this node, and their properties. \nFormat : as defined in the table below. \n \n<node_id> for Queue Length Nodes is of the form annotate_queueX (ex. annotate_queue1)

Example

"nodes": {
    "annotate_queue1": {
        "type": "annotate_queue",
        "rois": {
            "<roi_label>": {
                "coords": [
                    [468, 172],
                    [597, 307],
                    [912, 206],
                    [1227, 277],
                    [1247, 135],
                    [1054, 91],
                    [946, 121],
                    [797, 87],
                    [645, 104],
                    [468, 172]
                ],
                "current_queue_size": 1,                  
                "max_queue_size": 2,
                "max_wait_time": 15,
                "mean_wait_time": 12,
                "min_queue_size": 0,
                "min_wait_time": 5,
                "objects_above_max_occupancy_count": 0,
                "objects_above_max_waiting_time_count": 1,
                "objects_above_max_waiting_time_delta": 0,
                "objects_entered_delta": 0,
                "objects_exited_delta": 1,
                "occupancy_above_max_threshold_delta": false,
                "occupancy_below_max_threshold_delta": false,
                "total_served": 0,
                "wait_alarms": 2,
                "current_objects": {
                    "<object_tracking_id>": {
                        "first_seen": 19.0,
                        "first_seen_utc": "2022-10-21T16:16:06.363395Z",
                        "time_present": 10.0
                    }
                },
                "exited_objects": {
                    "<object_tracking_id>": {
                        "first_seen": 13.0,
                        "first_seen_utc": "2022-10-21T16:16:05.072938Z",
                        "time_present": 15.933
                    }
                }                  
            }
        }
    }
}

Format

KeyTypeDescription
<roi_label>Array of dictionariesContains information about this specific ROI
<roi_label>.coordsDictionaryContains the bounding box coordinates that represent this ROI
<roi_label>.total_servedIntegerNumber of objects seen in this ROI since the start of the pipeline
<roi_label>.wait_alarmsIntegerTotal number of wait alarms generated. This counter is incremented every time an object reaches the maximum waiting time defined in the node properties.
<roi_label>.current_queue_sizeIntegerCurrent number objects in queue
<roi_label>.objects_entered_deltaIntegerNumber of objects that entered the ROI between last frame and this frame
<roi_label>.objects_exited_deltaIntegerNumber of objects that left the ROI between last frame and this frame
<roi_label>.objects_above_max_waiting_time_countIntegerNumber of objects currently inside the ROI above the specified temporal threshold
<roi_label>.objects_above_max_waiting_time_deltaIntegerNumber of new objects that exceeded the threshold between the last frame and this frame
<roi_label>.objects_above_max_occupancy_countIntegerNumber of new objects that exceeded the max occupancy threshold
<roi_label>.occupancy_above_max_threshold_deltaBoolTrue when the total number of objects is above the max occupancy threshold
<roi_label>.occupancy_below_max_threshold_deltaBoolTrue when the total number of objects is below the max occupancy threshold
<roi_label>.min_queue_sizeIntegerMinimum number of objects in queue
<roi_label>.max_queue_sizeIntegerMaximum number of objects in queue
<roi_label>.min_wait_timeIntegerThe minimum queue waiting time in seconds
<roi_label>.max_wait_timeIntegerThe maximum queue waiting time in seconds
<roi_label>.mean_wait_timeIntegerThe mean queue waiting time in seconds
<roi_label>.current_objectsArray of dictionariesInformation about the objects currently in the ROI \n \nobject_tracking_id : Unique identifier for a specific object, as specified by object.id property (see AI Model Node ) \n \nfirst_seen : Time in seconds (since start of deployment) when the object was first seen in the ROI \n \nfirst_seen_utc : UTC time in ISO 8601 format when the object was first seen in the ROI \n \ntime_present : Time in seconds that the object has been present in the ROI
<roi_label>.exited_objectsArray of dictionariesInformation about the objects that left the ROI in the previous frame \n \nobject_tracking_id : Unique identifier for a specific object, as specified by object.id property (see AI Model Node ) \n \nfirst_seen : Time in seconds (since start of deployment) when the object was first seen in the ROI \n \nfirst_seen_utc : UTC time in ISO 8601 format when the object was first seen in the ROI \n \ntime_present : Time in seconds that the object was present in the ROI