Luna Human Tracking Analytic (v.0.0.1)

Download OpenAPI specification:Download

Luna Human Tracking Analytic used for tracking people face or/and body on a video with subsequent dispatch tracking results to handler for generating event according to handler policies. Before being formed, tracking results are filtered with specified filters and sent to handlers according to the event policy setting. Handler can use raw images (raw_images) with detections or face/body warps (samples) as sources for event generation. Note that proper analytic targets and parameters must be set to provide the handler with the selected source type, otherwise there will be no data to send and events won't be generated. After events are successfully generated, they will be sent callbacks. In addition, tracking results can be received by subscription to web sockets.

human-tracking

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: ["face_detection"]
Items Enum: "face_detection" "body_detection" "head_pose" "ags" "aggregated_face_samples" "aggregated_body_samples"

Estimations to perform on the video.

**Note that targets must correspond with selected detector type

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 (human_tracking_analytic_parameters)

Request samples

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

callback request

Callback request schema and example.

Request Body schema: application/json
account_id
string

Account id of event.

event_create_time
string

Event creation time.

event_end_time
string

Event end time.

event_type
string
Value: "human_tracking"

Event type.

event
object (handlers_reply_event)

Event received after detections processing by handler. Event contains information about face and/or body of a single person. See luna-handlers documentation for details

Request samples

Content type
application/json
{
  • "account_id": "string",
  • "event_create_time": "string",
  • "event_end_time": "string",
  • "event_type": "human_tracking",
  • "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
string <uuid> (stream_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: stream_id=557d54ec-29ad-4f3c-93b4-c9092ef12515

Stream ID for events you need to subscribe to.

account_id
string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=557d54ec-29ad-4f3c-93b4-c9092ef12515

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": {
    }
}