Metropolis Occupancy Alerts

Overview

Metropolis Occupancy Alerts does streaming analytics of vision inference metadata and produces insights in the form of time series metrics, alerts and enriched events. It provides rich situational awareness about the environment monitored by sensors.

Design

Architecture_Diagram

Input

  1. Message stream of per frame face bounding box. This is published by Face Detection and Tracking over Redis.

  2. Message stream of camera add/remove events. This is published by Video Management over Redis.

Output

  1. Message stream of Occupancy Alerts

Metropolis Occupancy Alerts functional modules

  • Field of View (FOV): Counting of objects in the camera field of view

  • Tripwire (Tripwire) : Detect object crossing across a defined tripwire line

  • Region of Interest (ROI): Counting of object present in a defined closed region of interest

FOV

Field of View represents the full camera view. FOV module can track movement of objects (e.g People, Face, Vehicle) within the full field of view and provides time series metrics, and alerts related to it.

FOV Occupancy Alerts:

Alerts’ rules can be configured to raise Alerts when the FOV gets occupied or vacant by entry and exit of objects into the FOV area.

Role of Metropolis Occupancy Alerts in Tokkio App

Metropolis Occupancy alerts provide high level vision triggers to start and stop conversation.

Vision trigger to start and stop a conversation

FOV module provides the triggers (in form of alerts) to start the conversation when one or more users in a group enter/exit the Field of View of the camera. Riva components consume this trigger to start and stop the conversation.

How to configure Metropolis Occupancy Alerts for Tokkio

Configure FOV and Occupancy Alerts

Tokkio App comes pre-configured with a sensor template definition. This is defined in Tokkio deployment application parameters file tokkio-app-params.yaml under the emdx-analytics section as follows. For any newly discovered sensor this template is used to configure the sensor with the FOV occupancy alert at runtime.

Default configuration:

emdx-analytics:
    sensorTemplate:
        alert_rules:
            fov:
                rules:
                - count_threshold: 1
                id: alert_rule_id_1
                rule_type: occupancy_threshold_switch
                time_interval: 1
                type: fov
                parameters:
                - name: time_interval_up
                    value: 1
                - name: time_interval_down
                    value: 2
            roi:
                rules: []
            tripwire:
                rules: []
        gaze_rois: []
        rois: []
        tripwires: []

An installation can have multiple sensors over the period of time. The above sensorTemplate is used to configure each new sensor.

A sensor can have alert rules defined for FOV under the property sensorTemplate.alert_rules.fov.rules

Description: Configures an Alert rule based on change of occupancy above or below count_threshold of detected objects present in the FOV.

Simple use case is when FOV status changes from vacant (occupancy == 0) to occupied (occupancy > 0). The inverse of this is when occupancy changes from occupied (occupancy > 0) to vacant ( occupancy == 0).

Alert rule attributes

id: This refers to the id of this alert rule. This should be unique across all alert rules for the FOV

FOV can have multiple alert rules associated with it.

count_threshold: Number of counts threshold used to determine status change.

  • A count_threshold of zero indicates alert to be raised when occupancy changes from zero to greater than zero.

  • Inverse of this is when occupancy falls to zero from a positive number greater than zero the alert is raised.

  • A positive non-zero count_threshold (N) means we want to raise the alert when occupancy exceeds N, raise the UP alert (direction=up), while when the occupancy falls to N or below, raise the DOWN (direction=down) alert.

  • The alert message direction attribute will contain ‘up’ or ‘down’ to indicate above and below threshold crossing events.

time_interval : Time window. Specified in seconds.

  • Indicate the duration for which the counts need to be above or below the threshold for the alert to be raised.

  • It is used to deal jitters in occupancy counts and smoothen the publication of alerts in case of such jitters.

  • Separate value of time_interval for UP and DOWN events can be specified using the parameters extensions. See parameters property description below

rule_type: ‘occupancy_threshold_switch’

type: fixed value fov

parameters: Additional parameters to customize the alert rule.

  • Parameters are provided to specify separate values of time_interval for UP and DOWN events.

  • When specified this overrides the default value of UP/DOWN event specified in the top level time_interval property.

  • For example to set a time_interval of 2 seconds for UP event and 3 seconds for DOWN event add following two parameter to the parameters property

Custom configuration:

- name: time_interval_up
  value:2
- name:time_interval_down
  value:3

Helm installation time values overrides

While installing the Tokkio App helm chart these values can be overridden to specify a custom ROI definition in the values.yaml file.

Configure redis stream for Metropolis Occupancy Alerts

Metropolis Occupancy Alerts consumes vision metadata from Deepstream component and publishes alerts. It also consumes VMS camera status events to auto-configure sensor rules as per the sensorTemplate parameters The integration is done through asynchronous Redis streams. In the application configuration file connection is specified as follows.

Connection:

occupancy-alerts/redis: redis-timeseries/redis

The default Redis stream names can be customized using following parameters. Given below are the default working values.

Default configuration:

emdx-analytics:
    vstEventsStream: vst_events
    metadataStream: test
    alertsStream: emdat_alert_events

See the Redis configuration example below, where the metadataStream is represented with name vision_metadata, instead of default value test

Example custom configuration:

emdx-analytics:
    vstEventsStream: vst_events
    metadataStream: vision_metadata
    alertsStream: emdat_alert_events

Redis Stream parameters

vstEventsStream: The redis stream name which is used by VMS to publish camera status change events.

metadataStream: The redis stream name which is used by Deepstream to publish vision metadata.

alertsStream : The redis stream name which is used by Metropolis Occupancy Alerts to publish alerts.