Configuration

Below are different ways to configure the provided reference application for your environment.


Videos

We have provided a Jupyter Notebook help you adapt the microservice to your own videos with ease. Refer to the Functionality Tutorial Notebook for the details.


Operation Parameters

The Heatmap Overlay microservice has various configurations that can be used to tailor the Occupancy Heatmap app to various scenarios.

Here is a full sample config file:

{
    "server": {
        "port": 5000,
        "host": "0.0.0.0",
        "use_reloader": false
    },
    "sqliteTaskStorage": {
        "location":"/opt",
        "fileName": "overlay_tasks.db"
    },
    "dataStorage": {
        "taskStorage": {
            "backend": "sqliteTaskStorage"
        }
    },
    "workflows": {
        "downloadFilePath": "/opt",
        "videoIngestion" :{
            "apiEndPoint": "http://localhost:81/api/"
        },
        "calibrationIngestion" : {
            "apiEndPoint": "http://localhost:8081/"
        },
        "elasticSearchIngestion": {
            "apiEndPoint": "http://localhost:9200"
        },
        "tripwireAnnotator": {
        },
        "heatmapAnnotator" : {
            "heatmapWindow": 0,
            "bwMethodRadius": 30,
            "granularity": 100,
            "mgridWidth": 900,
            "mgridHeight": 1000
        }
    }
}

Where:

  • server.port: Port of the restful service.

  • server.host: Host IP of the restful service.

  • server.use_reloader: use_reloader flag.

  • sqliteTaskStorage.location: SQL db path location. SQL db is used for storing the status of all submitted annotation tasks.

  • sqliteTaskStorage.fileName: SQL db file name. SQL db is used for storing the status of all submitted annotation tasks.

  • dataStorage.taskStorage.backend: db backend. Currently supports sqliteTaskStorage.

  • workflows.downloadFilePath: The folder path to store the downloaded contents, including video file from MMS and metadata from ES.

  • workflows.videoIngestion.apiEndPoint: The MMS API end point for video content fetching.

  • workflows.calibrationIngestion.apiEndPoint: The Metropolis microservices web API end point for calibration fetching.

  • workflows.elasticSearchIngestion.apiEndPoint: The ElasticSearch API end point for metadata fetching.

  • workflows.heatmapAnnotator.heatmapWindow: The window duration where heatmap is created from in number of frames. setting it to 0 to use all history.

  • workflows.heatmapAnnotator.bwMethodRadius: The standard deviation of the kde estimation. Gaussian kernel is used for kde estimation.

  • workflows.heatmapAnnotator.granularity: The granularity of the kde smoothed mesh grid.

  • workflows.heatmapAnnotator.mgridWidth: The estimated width of the projected “plan map” in centimeters.

  • workflows.heatmapAnnotator.mgridHeight: The estimated height of the projected “plan map” in centimeters.

You can change workflows.heatmapAnnotation.heatmapAnnotator.heatmapWindow and workflows.heatmapAnnotation.heatmapAnnotator.bwMethodRadius to achieve different visual results. The following samples show the effect of workflows.heatmapAnnotation.heatmapAnnotator.heatmapWindow and workflows.heatmapAnnotation.heatmapAnnotator.bwMethodRadius:

  1. case1: bwMethodRadius = 30, heatmapWindow = 30:

Heatmap is drawn every frame using the detections from past 30 frames with the std of kde = 30:

Overlay Module Integrated
  1. case2: bwMethodRadius = 90, heatmapWindow = 10:

By increasing the bw, the kde smoothed color spans the larger area.

Overlay Module Integrated
  1. case3: bwMethodRadius = 30, heatmapWindow = 0:

By setting window = 0, all past detections up to the current point is used to draw heatmap for each frame:

Overlay Module Integrated