Human Tracking (v.3.0.0)

Download OpenAPI specification:Download

Luna Human Tracking Analytic is intended for tracking people faces and/or bodies on a video with subsequent dispatch of tracking results to a luna-handlers handler for event generation according to the handler policies.

The human tracking analytic decodes stream frames (every frame by default) taking into account rate parameter from analytic parameters and performs the following actions:

  • Tracks faces and/or bodies (depending on the tracking.detector_type) and performs estimations according to the targets from analytic parameters.

  • Collects face and body samples which satisfy the face_samples and body_samples filters.

  • Generates events according to the event_policy and sends them to the handler specified by handler_id. The handler uses raw images (raw_images) with detections or face/body warps (samples) as sources for event generation. Note that proper targets 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.

  • For each callback executes it with the generated event.

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

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 non-empty unique
Default: ["face_detection"]
Items Enum: "overview" "face_detection" "landmarks5" "head_pose" "ags" "warp_quality" "emotions" "mask" "glasses" "eyes" "gaze" "mouth" "aggregated_liveness" "aggregated_deepfake" "aggregated_face_samples" "aggregated_face_thumbnail" "aggregated_face_basic_attributes" "aggregated_face_descriptor" "body_detection" "aggregated_body_samples" "aggregated_body_thumbnail" "aggregated_body_attributes" "aggregated_body_descriptor"

Estimations to perform on the video.

Face targets (face_detection, landmarks5, head_pose, ags, warp_quality, emotions, mask, glasses, eyes, gaze, mouth and aggregated_face_*, aggregated_liveness, aggregated_deepfake) require face or human detector type.

Body targets (body_detection and aggregated_body_*) require body or human detector type.

overview will add overview processing and enable image saving.

Array of objects <= 10 items

Callbacks parameters.

object

Estimation parameters.

Responses

Request samples

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

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
required
string
Value: "human_tracking"

Event type.

required
object

Event generated by the luna-handlers handler (handler_id) from the tracking results, see luna-handlers documentation for details. Event contains information about face and/or body of a single person. The analytic adds the following stream properties to the event.

Responses

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
any

Stream ID for events you need to subscribe to.

account_id
any

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
{
  • "stream_status": "in_progress",
  • "error": "decoding error",
  • "analytics_results": {
    }
}