Luna People Count Analytic (v.0.1.2)

Download OpenAPI specification:Download

Luna People Count Analytic is intended for determination of:

  • number of people
  • people coordinates

The people count analytic decode stream frames (every 10th frame by default) taking into account rate parameter from analytic parameters and performs the following actions:

  • Calculates number of people and optionally (depending on the targets from analytic parameters) people coordinates on frame.

  • Performs frame processing according to policies - optionally save frame as image.

  • For each callback check it's conditions and execute callbacks, which fit conditions.

    The schema of data sending by callback described at callback schema.

people-count

analytic parameters

Analytic parameters schema and example. Applicable to use as analytics.parameters of create stream request in Luna-Video-Manager

Request Body schema: application/json
targets
Array of strings
Default: []
Items Enum: "coordinates" "overview"

Estimations to perform on the video.

coordinates will add people_coordinates to frames estimations.

overview will add overview processing and enable image saving.

Array of any (callback) <= 10 items

Callbacks parameters.

http type callback sends events to the specified url by POST request.

luna-ws-notification type callback sends events to websocket using sender.

object

Estimation parameters.

Request samples

Content type
application/json
{
  • "parameters": {
    },
  • "callbacks": [],
  • "targets": [
    ]
}

callback request

Callback request schema and example.

Request Body schema: application/json
event_type
required
string
Value: "crowd"

Event type.

account_id
required
string

Account id of event.

event_create_time
required
string

Event creation time.

event_end_time
required
string

Event end time.

required
object

Event.

Request samples

Content type
application/json
{
  • "event_type": "crowd",
  • "account_id": "string",
  • "event_create_time": "string",
  • "event_end_time": "string",
  • "event": {
    }
}

ws events handshake

Ws events handshake. The resource is designed to receive realtime events from analytics.

Attention!

Subscription to events occurs via WebSocket. Messages sent by ws you can view in callback section. Connection supports autoping.

query Parameters
stream_id
required
any (stream_id)

Stream ID for events you need to subscribe to.

account_id
any (account_id)

Account id of stream owner.

Responses

Request samples

import asyncio
import websockets

async def main():
    uri = "ws://127.0.0.1:5240/1/ws?stream_id=70c75b04-1ec8-4aa1-930c-ddad9e47b54b"  # Note filtering by gender!
    async with websockets.connect(uri) as websocket:
        while True:
            data = await websocket.recv()
            print(data)


asyncio.run(main())

Response samples

Content type
application/json
Example
{
  • "stream_status": "in_progress",
  • "error": null,
  • "analytics_results": {
    }
}