Download OpenAPI specification:Download
Luna People Count Analytic
is intended for determination of:
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.
Analytic parameters schema and example. Applicable to use as analytics.parameters
of create stream
request in Luna-Video-Manager
targets | Array of strings Default: [] Items Enum: "coordinates" "overview" Estimations to perform on the video.
|
Array of any (callback_people_count) <= 10 items Callbacks parameters.
| |
object Estimation parameters. |
{- "parameters": {
- "probe_count": 2,
- "image_retain_policy": {
- "mimetype": "PNG"
}
}, - "callbacks": [
], - "targets": [
- "coordinates",
- "overview"
]
}
Callback request schema and example.
account_id required | string Account id of event. |
event_create_time required | string Event creation time. |
event_end_time required | string Event end time. |
event_type required | string Value: "crowd" Event type. |
required | object Event. |
{- "account_id": "string",
- "event_create_time": "string",
- "event_end_time": "string",
- "event_type": "crowd",
- "event": {
- "stream_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "event_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "track_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "people_count": 0,
- "overview": {
- "people_coordinates": [
- [
- 64,
- 128
], - [
- 491,
- 375
]
], - "image": "string",
- "time_offset": 1.234
}, - "location": {
- "city": "Moscow",
- "area": "Central",
- "district": "Basmanny",
- "street": "Podsosensky lane",
- "house_number": "23 bldg.3",
- "geo_position": {
- "longitude": 36.616,
- "latitude": 55.752
}
}, - "video_segment": {
- "start_time_offset": 0.123,
- "end_time_offset": 1.234
}
}
}
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. |
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())
{- "stream_status": "in_progress",
- "error": null,
- "analytics_results": {
- "crowd": {
- "track_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "event_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "people_count": 2,
- "time_offset": 1.234,
- "event_status": "started",
- "people_coordinates": [
- [
- 64,
- 128
], - [
- 491,
- 375
]
]
}
}
}