Jump to content

Metropolis Microservices/RidgeRun Services/Engagement Analytics: Difference between revisions

No edit summary
Line 45: Line 45:
== Service Configuration ==
== Service Configuration ==


The service can be configured in 2 different ways: providing a configuration file via the '''--config_file''' CLI argument or via the '''/configuration''' request (see the [service API documentation]). In both cases the configuration will be in JSON format as follows:
The service can be configured in 2 different ways: providing a configuration file via the '''--config-file''' CLI argument or via the '''/configuration''' request (see the [service API documentation]). In both cases, the configuration will be in JSON format as follows:


<syntaxhighlight lang="JSON">
<syntaxhighlight lang="JSON">
{
{
     "inputs": {
     "heatmap": {
         "cameras": [
         "window_seconds": 3600,
             "cam0",
        "eps": 40,
             "cam1"
        "min_samples": 2,
        "update_period": 10
    },
    "engagement": [
        {
             "id": "cam0",
             "roi": [
                {
                    "x": 0,
                    "y": 1079
                },
                {
                    "x": 1919,
                    "y": 1079
                }
            ]
        },
        {
            "id": "cam1",
            "roi": [
                {
                    "x": 0,
                    "y": 1079
                },
                {
                    "x": 1919,
                    "y": 1079
                }
            ]
        }
     ],
     ],
     "heatmap": true
     "db_update_period": 5,
    "message_expiration": 5
}
}
</syntaxhighlight>
</syntaxhighlight>
This configuration allows to include any number of cameras using this format.  The identifies cam0, cam1, camN need to match the same names used on the Camera service to identify each camera.


The configuration entries are as follows:
The configuration entries are as follows:


*'''cameras:''' The list of the camera to be displayed. This name has to match any of the camera streams provided by the [https://developer.ridgerun.com/wiki/index.php/Metropolis_Microservices/RidgeRun_Services/Camera Camera Service].
*'''heatmap:''' This is the configuration for the heatmap generation.
*'''heatmap:''' Define whether a heatmap representing the engagement is shown on top of the BEV.
**'''window_seconds:''' This is the window of time that will be used for the heatmap generation. Any sample older than this time will be discarded.
**'''eps:''' This is the maximum distance between 2 samples to be considered part of the same group.
**'''min_samples:''' This is the minimum number of samples in a group to be considered. Any group with less that this number of samples will be discarded.
**'''update_period:''' This is the period used to generate and update the heatmap. Data will be constantly collected but the heatmap will be calculated and posted in redis with this period in seconds.
*'''engagement:''' This is the data for engagement calculation. It is an array with one element per camera.
**'''id:''' The id of the camera.
**'''roi:''' This is the target region for the engagement. Any person whose direction points to this defined region is considered to be engaged. It supports 1 or 2 points. In case of one point, the person is considered to be engaged if it is looking at that point. In case of 2 points, the person is considered to be engaged if it is looking at the rect defined by the 2 points.
*'''db_update_period:''' This is the period of time used to update the influx database with statistics.
*'''message_expiration:''' This is the amount of seconds used for engagement messages expiration. If a person is not seen for this configured amount of time, the entry will automatically disappear from redis.


== Heatmap ==  
== Heatmap ==  
Cookies help us deliver our services. By using our services, you agree to our use of cookies.