Download OpenAPI specification:Download
VisionLabs Luna Platform 5 API. The API version is 6.
OpenAPI specification is the only valid document providing up-to-date information about the service API.
The specification can be used:
All the documents and code generated using this specification can include inaccuracies and should be carefully checked.
OpenAPI specification can be received using the /docs/spec resource. The "Accept" header should be set to "application/x-yaml".
Get versions of services.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "LUNA PLATFORM": {
- "major": 0,
- "minor": 0,
- "patch": 0
}, - "luna-api": {
- "api": 5,
- "major": 3,
- "minor": 1,
- "patch": 2
}, - "luna-events": {
- "api": 1,
- "major": 1,
- "minor": 0,
- "patch": 5
}, - "luna-faces": {
- "api": 2,
- "major": 2,
- "minor": 3,
- "patch": 9
}, - "luna-image-store-bodies-samples": {
- "api": 1,
- "major": 2,
- "minor": 1,
- "patch": 11
}, - "luna-image-store-faces-samples": {
- "api": 1,
- "major": 2,
- "minor": 1,
- "patch": 10
}, - "luna-image-store-images": {
- "api": 1,
- "major": 2,
- "minor": 1,
- "patch": 13
}, - "luna-handlers": {
- "api": 1,
- "major": 1,
- "minor": 0,
- "patch": 0
}, - "luna-tasks": {
- "api": 1,
- "major": 1,
- "minor": 0,
- "patch": 13
}, - "luna-matcher-proxy": {
- "api": 1,
- "major": 1,
- "minor": 0,
- "patch": 0
}, - "luna-remote-sdk": {
- "api": 1,
- "major": 1,
- "minor": 0,
- "patch": 0
}, - "luna-lambda": {
- "api": 1,
- "major": 1,
- "minor": 0,
- "patch": 0
}
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get accounts.
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
login | string (login) [ 3 .. 128 ] characters ^[a-z0-9_\-\.]+@[a-z]+\.[a-z]{2,}$ Example: login=user@visionlabs.ru Account login. |
account_type | string (account_type) Enum: "advanced_user" "user" "admin" Example: account_type=user Account type. |
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. |
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. |
targets | Array of strings Default: ["account_id","login","account_type","description","create_time","last_update_time"] Items Enum: "account_id" "login" "account_type" "description" "create_time" "last_update_time" Example: targets=login Comma-separated list of account target fields. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" url = f"{baseUri}/accounts" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=" } response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "accounts": [
- {
- "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "login": "mylogin@gmail.com",
- "account_type": "advanced_user",
- "description": "main admin account",
- "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z"
}
], - "total_count": 50
}
Create an account.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID for new account creation. |
login required | string (login) [ 3 .. 128 ] characters ^[a-z0-9_\-\.]+@[a-z]+\.[a-z]{2,}$ Account email. |
password required | string (password) [ 3 .. 128 ] characters ^.{3,128}$ Account password. |
account_type required | string (account_type_for_creation) Enum: "advanced_user" "user" Specified user account type:
|
description | string (account_description) <= 128 characters Default: "" Account description. |
{- "login": "mylogin@gmail.com",
- "password": "string",
- "account_type": "advanced_user",
- "description": "main admin account"
}
{- "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "url": "/6/account",
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get account.
targets | Array of strings Default: ["account_id","login","account_type","description","create_time","last_update_time"] Items Enum: "account_id" "login" "account_type" "description" "create_time" "last_update_time" Example: targets=login Comma-separated list of account target fields. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" url = f"{baseUri}/account" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=" } response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "login": "mylogin@gmail.com",
- "account_type": "advanced_user",
- "description": "main admin account",
- "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z"
}
Patch account. At least one field must be specified.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
login | string (login) [ 3 .. 128 ] characters ^[a-z0-9_\-\.]+@[a-z]+\.[a-z]{2,}$ Account email. |
password | string (password) [ 3 .. 128 ] characters ^.{3,128}$ Account password. |
account_type | string (account_type_for_creation) Enum: "advanced_user" "user" Specified user account type:
|
description | string (account_description) <= 128 characters Default: "" Account description. |
{- "login": "mylogin@gmail.com",
- "password": "string",
- "account_type": "advanced_user",
- "description": "main admin account"
}
{- "error_code": 12022,
- "desc": "Bad/incomplete input data",
- "detail": "Failed to validate input json. Path: 'extra_field', message: 'extra fields not permitted'"
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a token.
grant_all_permissions | integer Default: 0 Enum: 0 1 Grant all permissions to token. 1 - give, 0 - do not give.
If value is |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
required | object Token permissions. * It is possible to use custom fields for permissions besides those given here. Custom fields must have 3-16 characters (lowercase letters, _) with possible permissions:
|
description | string (token_description) <= 128 characters Default: "" Token description. |
expiration_time required | string or null <date-time> Token expiration time in RFC 3339 format. |
visibility_area | string (visibility_area) Default: "all" Enum: "account" "all" Specifies data visible for the token. For accounts with type
|
{- "description": "main account token",
- "expiration_time": "2050-11-11T11:11:11.111+03:00",
- "permissions": {
- "account": [
- "view"
], - "face": [
- "creation",
- "view",
- "modification",
- "deletion",
- "matching"
], - "list": [
- "creation",
- "view",
- "modification",
- "deletion"
], - "event": [
- "creation",
- "view",
- "matching"
], - "attribute": [
- "creation",
- "view",
- "modification",
- "deletion",
- "matching"
], - "handler": [
- "creation",
- "view",
- "modification",
- "deletion"
], - "verifier": [
- "creation",
- "view",
- "modification",
- "deletion"
], - "task": [
- "creation",
- "view",
- "modification",
- "deletion"
], - "face_sample": [
- "creation",
- "view",
- "deletion"
], - "body_sample": [
- "creation",
- "view",
- "deletion"
], - "image": [
- "creation",
- "view",
- "deletion"
], - "object": [
- "creation",
- "view",
- "deletion"
], - "token": [
- "creation",
- "view",
- "modification",
- "deletion"
], - "resources": [
- "iso",
- "sdk",
- "liveness"
], - "emit_events": {
- "allowed": 1,
- "white_list": null,
- "black_list": null
}, - "lambdas": [
- "creation",
- "view",
- "modification",
- "deletion"
], - "verify": {
- "allowed": 1,
- "white_list": null,
- "black_list": null
}
}, - "visibility_area": "all"
}
{- "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbklkIjoiN2Q0MjYwNmEtZmM3NS00NDU4LWE3OGUtOWYzNGM2MjIyZWQyIiwiZXhwaXJhdGlvblRpbWUiOm51bGwsImFjY291bnRJZCI6IjdkYjUzNThiLWZjMzMtNDIwZC1hYTgzLTk5YTRkOWY0MGM0MSJ9.kDL5oLTJaxKyYbwmKV1lejxrzsFoFzx5VOzvTR-i90k",
- "token_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "url": "/6/tokens/557d54ec-29ad-4f3c-93b4-c9092ef12515",
}
Get tokens.
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. |
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create token url = f"{baseUri}/tokens" headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} payload = {"permissions": {"face": ["view"]}, "description": "description"} requests.post(url, json=payload, headers=headers) headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=" } url = f"{baseUri}/tokens" response = requests.get(url, headers=headers, params={"page": 1, "page_size": 10}) print(response.status_code) print(response.json())
{- "tokens": [
- {
- "permissions": {
- "account": [ ],
- "face": [ ],
- "list": [ ],
- "event": [ ],
- "attribute": [ ],
- "handler": [ ],
- "verifier": [ ],
- "task": [ ],
- "face_sample": [ ],
- "body_sample": [ ],
- "image": [ ],
- "object": [ ],
- "token": [
- "view"
], - "resources": [ ],
- "emit_events": {
- "allowed": 1,
- "white_list": null,
- "black_list": null
}, - "lambdas": [ ],
- "verify": {
- "allowed": 1,
- "white_list": null,
- "black_list": null
}, - "video_stream": [ ],
- "video_group": [ ],
- "video_analytic": [ ]
}, - "description": "main account token",
- "expiration_time": "2050-11-11T11:11:11.111+03:00",
- "visibility_area": "account",
- "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbklkIjoiN2Q0MjYwNmEtZmM3NS00NDU4LWE3OGUtOWYzNGM2MjIyZWQyIiwiZXhwaXJhdGlvblRpbWUiOm51bGwsImFjY291bnRJZCI6IjdkYjUzNThiLWZjMzMtNDIwZC1hYTgzLTk5YTRkOWY0MGM0MSJ9.kDL5oLTJaxKyYbwmKV1lejxrzsFoFzx5VOzvTR-i90k",
- "token_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z"
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Update token. You cannot update a part of the token, so you should specify all the fields for your token.
token_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 8950722f-3fd4-4223-b48f-03f95f0e8dfb Token ID. |
grant_all_permissions | integer Default: 0 Enum: 0 1 Grant all permissions to token. 1 - give, 0 - do not give.
If value is |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
required | object Token permissions. * It is possible to use custom fields for permissions besides those given here. Custom fields must have 3-16 characters (lowercase letters, _) with possible permissions:
|
description | string (token_description) <= 128 characters Default: "" Token description. |
expiration_time required | string or null <date-time> Token expiration time in RFC 3339 format. |
visibility_area | string (visibility_area) Default: "all" Enum: "account" "all" Specifies data visible for the token. For accounts with type
|
{- "permissions": {
- "account": [ ],
- "face": [ ],
- "list": [ ],
- "event": [ ],
- "attribute": [ ],
- "handler": [ ],
- "verifier": [ ],
- "task": [ ],
- "face_sample": [ ],
- "body_sample": [ ],
- "image": [ ],
- "object": [ ],
- "token": [
- "view"
], - "resources": [ ],
- "emit_events": {
- "allowed": 1,
- "white_list": null,
- "black_list": null
}, - "lambdas": [ ],
- "verify": {
- "allowed": 1,
- "white_list": null,
- "black_list": null
}, - "video_stream": [ ],
- "video_group": [ ],
- "video_analytic": [ ]
}, - "description": "main account token",
- "expiration_time": "2050-11-11T11:11:11.111+03:00",
- "visibility_area": "account"
}
{- "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbklkIjoiN2Q0MjYwNmEtZmM3NS00NDU4LWE3OGUtOWYzNGM2MjIyZWQyIiwiZXhwaXJhdGlvblRpbWUiOm51bGwsImFjY291bnRJZCI6IjdkYjUzNThiLWZjMzMtNDIwZC1hYTgzLTk5YTRkOWY0MGM0MSJ9.kDL5oLTJaxKyYbwmKV1lejxrzsFoFzx5VOzvTR-i90k",
- "token_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "url": "/6/tokens/557d54ec-29ad-4f3c-93b4-c9092ef12515",
}
Get token by ID.
token_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 8950722f-3fd4-4223-b48f-03f95f0e8dfb Token ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=" } url = f"{baseUri}/tokens" payload = {"permissions": {"face": ["view"]}, "description": "description", "expiration_time": None} tokenId = requests.post(url, json=payload, headers=headers).json()["token_id"] url = f"{baseUri}/tokens/{tokenId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "permissions": {
- "account": [ ],
- "face": [ ],
- "list": [ ],
- "event": [ ],
- "attribute": [ ],
- "handler": [ ],
- "verifier": [ ],
- "task": [ ],
- "face_sample": [ ],
- "body_sample": [ ],
- "image": [ ],
- "object": [ ],
- "token": [
- "view"
], - "resources": [ ],
- "emit_events": {
- "allowed": 1,
- "white_list": null,
- "black_list": null
}, - "lambdas": [ ],
- "verify": {
- "allowed": 1,
- "white_list": null,
- "black_list": null
}, - "video_stream": [ ],
- "video_group": [ ],
- "video_analytic": [ ]
}, - "description": "main account token",
- "expiration_time": "2050-11-11T11:11:11.111+03:00",
- "visibility_area": "account",
- "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbklkIjoiN2Q0MjYwNmEtZmM3NS00NDU4LWE3OGUtOWYzNGM2MjIyZWQyIiwiZXhwaXJhdGlvblRpbWUiOm51bGwsImFjY291bnRJZCI6IjdkYjUzNThiLWZjMzMtNDIwZC1hYTgzLTk5YTRkOWY0MGM0MSJ9.kDL5oLTJaxKyYbwmKV1lejxrzsFoFzx5VOzvTR-i90k",
- "token_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z"
}
Delete token by ID.
token_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 8950722f-3fd4-4223-b48f-03f95f0e8dfb Token ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=" } url = f"{baseUri}/tokens" payload = {"permissions": {"face": ["view"]}, "description": "description", "expiration_time": None} tokenId = requests.post(url, json=payload, headers=headers).json()["token_id"] url = f"{baseUri}/tokens/{tokenId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Get options for the resource.
token_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 8950722f-3fd4-4223-b48f-03f95f0e8dfb Token ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Verify account or login with password or token.
account id
verification, account_type
will be returnedlogin
/password
verification, account_id
and account_type
will be returnedtoken
verification, account_type
and token permissions
will be returnedLuna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
login required | string (login) [ 3 .. 128 ] characters ^[a-z0-9_\-\.]+@[a-z]+\.[a-z]{2,}$ Account email. |
password required | string (password) [ 3 .. 128 ] characters ^.{3,128}$ Account password. |
{- "login": "mylogin@gmail.com",
- "password": "string"
}
{- "account_type": "advanced_user",
- "permissions": {
- "account": [ ],
- "face": [ ],
- "list": [ ],
- "event": [ ],
- "attribute": [ ],
- "handler": [ ],
- "verifier": [ ],
- "task": [ ],
- "face_sample": [ ],
- "body_sample": [ ],
- "image": [ ],
- "object": [ ],
- "token": [
- "view"
], - "resources": [ ],
- "emit_events": {
- "allowed": 1,
- "white_list": null,
- "black_list": null
}, - "lambdas": [ ],
- "verify": {
- "allowed": 1,
- "white_list": null,
- "black_list": null
}, - "video_stream": [ ],
- "video_group": [ ],
- "video_analytic": [ ]
}, - "account_id": "string"
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Detect faces and/or human bodies and estimate attributes on the input images. After the request is performed, the received data is not saved to the database or Image Store, it is only returned in the response.
The order of input images corresponds to the order of the elements in the output JSON.
If an input image is corrupted, an error is returned for the image. The processing of the other images continues in normal mode.
Notes for incoming data:
image_type | integer Default: 0 Enum: 0 1 2 Type of input image. 0 - raw image, 1 - face warped image, 2 - body warped image. | ||||||||
estimate_people_count | integer (int01) Default: 0 Enum: 0 1 Whether to estimate people count on the image. âš People counter licensing feature is required to be enabled to perform estimation. | ||||||||
people_count_coordinates | integer Default: 1 Enum: 0 1 Whether to return people coordinates with people count estimation. | ||||||||
multiface_policy | integer (multiface_policy) Default: 1 Enum: 0 1 2 Multiple face detection policy:
| ||||||||
detect_face | integer (detect_face) Default: 0 Enum: 0 1 Whether to detect faces on the image. | ||||||||
detect_body | integer (detect_body) Default: 0 Enum: 0 1 Whether to detect human bodies on the image. | ||||||||
estimate_head_pose | integer (estimate_head_pose) Default: 0 Enum: 0 1 Whether to estimate head pose in the image. The head pose is represented by pitch, yaw and roll angles. Not supported with warped images (see | ||||||||
estimate_emotions | integer (estimate_emotions) Default: 0 Enum: 0 1 Whether to estimate emotions in the image. The probability of the following emotions is estimated: "anger", "disgust", "fear", "happiness", "sadness", "surprise", "neutral". | ||||||||
estimate_mask | integer (estimate_mask) Default: 0 Enum: 0 1 Whether to estimate mask in the image. The probability of the following masks states is estimated: "medical_mask", "missing", "occluded". The estimated probability with the highest score is returned in the "predominant mask" parameter. | ||||||||
estimate_glasses | integer (estimate_glasses) Default: 0 Enum: 0 1 Whether to estimate glasses in the image. One of the following parameters is returned: "eyeglasses", "sunglasses", "no_glasses". | ||||||||
estimate_liveness | integer (int01) Default: 0 Enum: 0 1 Whether to estimate liveness in the image. The "quality" and "score" probabilities are estimated. Based on these probabilities, the following result is returned: "real", "spoof", "unknown". Liveness is utilized for this estimation. See "Administrator’s manual" for details about Liveness requirements. ⚠Webcam or selfie photos are required. Otherwise the result may be incorrect. ⚠Liveness licensing feature is required to be enabled to perform liveness estimation. Liveness estimation is not supported for samples (warped images). The | ||||||||
estimate_deepfake | integer (int01) Default: 0 Enum: 0 1 Whether to estimate deepfake feature on the image. âš Deepfake licensing feature is required to be enabled to perform deepfake estimation. Not supported with warped images (see | ||||||||
estimate_landmarks68 | integer (detect_landmarks68) Default: 0 Enum: 0 1 Whether to detect basic 68-point facial landmarks in the image. Not supported with warped images (see | ||||||||
estimate_landmarks5 | integer (detect_landmarks5) Default: 0 Enum: 0 1 Whether to detect basic 5-point facial landmarks in the image. Not supported with warped images (see | ||||||||
estimate_quality | integer (estimate_quality) Default: 0 Enum: 0 1 Whether to estimate input face image quality. Each of the following probabilities is estimated: "darkness", "light", "blurriness", "illumination", "specularity". The quality factor is estimated for each probability. It's value is in the range [0..1] where 0 corresponds to low quality and 1 to high quality. Note. Face recognition is not greatly affected by uneven illumination or high specularity. | ||||||||
estimate_gaze | integer (estimate_gaze) Default: 0 Enum: 0 1 Whether to estimate gaze in the image. The gaze is represented by yaw angle and pitch angle for both eyes at once. Not supported with warped images (see | ||||||||
estimate_eyes_attributes | integer (estimate_eyes_attributes) Default: 0 Enum: 0 1 Whether to estimate eye attributes in the image. The "right_eye" and "left_eye" parameters are estimated, which contain the "state" (opened, closed or occluded) and "iris_landmarks" parameters. | ||||||||
estimate_mouth_attributes | integer (estimate_mouth_attributes) Default: 0 Enum: 0 1 Whether to estimate mouth attributes in the image. Each of the following probabilities is estimated: "opened", "occluded", "smile", "score". | ||||||||
estimate_face_descriptor | integer (extract_descriptor) Default: 1 Enum: 0 1 Example: estimate_face_descriptor=1 Whether to estimate face descriptor(s). | ||||||||
estimate_basic_attributes | integer (extract_basic_attributes) Default: 0 Enum: 0 1 Whether to estimate face basic attributes (gender, age, ethnicity). | ||||||||
estimate_body_descriptor | integer (extract_descriptor) Default: 1 Enum: 0 1 Example: estimate_body_descriptor=1 Whether to create human body descriptor(s). | ||||||||
estimate_upper_body | integer (int01) Default: 0 Enum: 0 1 Whether to estimate human upper body on the image (headwear, clothing color, sleeve length). | ||||||||
estimate_lower_body | integer (int01) Default: 0 Enum: 0 1 Whether to estimate human lower body on the image (lower garment, shoes). | ||||||||
estimate_accessories | integer (int01) Default: 0 Enum: 0 1 Whether to estimate human body accessories on the image (backpack presence). | ||||||||
estimate_face_occlusion | integer (int01) Default: 0 Enum: 0 1 Whether to estimate face occlusion on the image. | ||||||||
estimate_body_basic_attributes | integer (int01) Default: 0 Enum: 0 1 Whether to estimate human body basic attributes on the image (age, gender). | ||||||||
estimate_body_warp | integer (estimate_body_warp) Default: 0 Enum: 0 1 Whether to create a human body warped image in the Base64 format. | ||||||||
estimate_face_warp | integer (estimate_face_warp) Default: 0 Enum: 0 1 Whether to create the face warped image in the Base64 format. | ||||||||
aggregate_attributes | integer (aggregate_attributes) Whether to aggregate the following parameters:
Aggregation will be performed only if the appropriate parameters for estimating the listed above parameters are enabled. If set, all estimated parameters from each image will be aggregated and displayed in the Otherwise, all estimated parameters from each image will be displayed in the | ||||||||
pitch_threshold | integer (pitch_threshold) [ 0 .. 180 ] Example: pitch_threshold=180 Maximum deviation pitch angle from 0. If the estimated value is equal or less than the threshold, the image is filtered. Remove this parameter from the query, or set the parameter value to 180 if pitch angle filtration is not required. When the value is set to "0", all the images are filtered. | ||||||||
roll_threshold | integer (roll_threshold) [ 0 .. 180 ] Example: roll_threshold=180 Maximum deviation roll angle from 0. If the estimated value is equal or less than the threshold, the image is filtered. Remove this parameter from the query, or set the parameter value to 180 if roll angle filtration is not required. When the value is set to "0", all the images are filtered. | ||||||||
yaw_threshold | integer (yaw_threshold) [ 0 .. 180 ] Example: yaw_threshold=180 Maximum deviation yaw angle from 0. If the estimated value is equal or less than the threshold, the image is filtered. Remove this parameter from the query, or set the parameter value to 180 if yaw angle filtration is not required. When the value is set to "0", all the images are filtered. | ||||||||
score_threshold | number (score_threshold) [ 0 .. 1 ] Default: 0 Example: score_threshold=0.7 Descriptor quality score threshold. The higher the quality score for the image, the better the extraction results. All the attributes with a quality score below the threshold will be ignored (and not stored in the DB). The function will proceed as usual with all the remaining descriptors (if left). Consult VisionLabs about the recommended value of this parameter. Note! This parameter is not related to the image quality estimated in the detect request ( | ||||||||
face_occlusion_states | Array of strings (face_occlusion_states) non-empty Items Enum: "face" "forehead" "eye" "nose" "mouth" "lower_face" Example: face_occlusion_states=face List of face area which must not be occluded. If any area are occluded on face then
face will be filtered. | ||||||||
mask_states | Array of integers (mask_states) non-empty Items Enum: 1 2 3 Example: mask_states=2&mask_states=3 Filter by mask states.
| ||||||||
liveness_states | Array of integers (liveness_states) non-empty Items Enum: 0 1 2 Example: liveness_states=1 Filter by liveness states.
| ||||||||
deepfake_states | Array of integers (deepfake_states) non-empty Items Enum: 0 1 Example: deepfake_states=1 Filter by deepfake states.
| ||||||||
use_exif_info | integer Default: 1 Enum: 0 1 Example: use_exif_info=1 Whether to try to auto orient image based on EXIF data. The processed image should have EXIF data, otherwise auto orientation will not be performed. Has no effect with tiff images (they're always auto oriented). Ignored with warped images (see | ||||||||
extract_exif | integer (extract_exif) Default: 0 Enum: 0 1 Whether to extract EXIF meta information from input JPEG images. Exact output will vary since there are no mandatory requirements for both authoring software and digital cameras how to write the data. This function will only parse the tags and output their names and values as they are. Please refer to JEITA CP-3451 EXIF specification for details. |
Accept | string Enum: "application/json" "application/msgpack" Accept request header. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Enum: "application/json" "multipart/form-data" "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64" |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
{- "images_estimations": [
- {
- "filename": "raw image",
- "exif": {
- "make": "Apple",
- "model": "iPhone 11",
- "gps": {
- "latitude": "55.0, 45.0, 18.29",
- "longitude": "37.0, 39.0, 16.32"
}, - "software": "13.6.1",
- "orientation": 6
}, - "estimations": [
- {
- "face": {
- "detection": {
- "rect": {
- "x": 71,
- "y": 45,
- "width": 134,
- "height": 178
}, - "landmarks5": [
- [
- 25,
- 25
], - [
- 83,
- 83
], - [
- 47,
- 47
], - [
- 33,
- 33
], - [
- 82,
- 82
]
], - "landmarks68": [
- [
- 1,
- 1
], - [
- 1,
- 1
], - [
- 4,
- 4
], - [
- 8,
- 8
], - [
- 14,
- 14
], - [
- 23,
- 23
], - [
- 33,
- 33
], - [
- 43,
- 43
], - [
- 60,
- 60
], - [
- 78,
- 78
], - [
- 96,
- 96
], - [
- 112,
- 112
], - [
- 124,
- 124
], - [
- 132,
- 132
], - [
- 135,
- 135
], - [
- 137,
- 137
], - [
- 138,
- 138
], - [
- 1,
- 1
], - [
- 8,
- 8
], - [
- 17,
- 17
], - [
- 26,
- 26
], - [
- 35,
- 35
], - [
- 59,
- 59
], - [
- 73,
- 73
], - [
- 86,
- 86
], - [
- 100,
- 100
], - [
- 113,
- 113
], - [
- 47,
- 47
], - [
- 45,
- 45
], - [
- 44,
- 44
], - [
- 43,
- 43
], - [
- 37,
- 37
], - [
- 42,
- 42
], - [
- 47,
- 47
], - [
- 54,
- 54
], - [
- 61,
- 61
], - [
- 14,
- 14
], - [
- 20,
- 20
], - [
- 29,
- 29
], - [
- 36,
- 36
], - [
- 28,
- 28
], - [
- 19,
- 19
], - [
- 69,
- 69
], - [
- 77,
- 77
], - [
- 86,
- 86
], - [
- 95,
- 95
], - [
- 88,
- 88
], - [
- 78,
- 78
], - [
- 33,
- 33
], - [
- 38,
- 38
], - [
- 45,
- 45
], - [
- 50,
- 50
], - [
- 57,
- 57
], - [
- 69,
- 69
], - [
- 82,
- 82
], - [
- 72,
- 72
], - [
- 60,
- 60
], - [
- 52,
- 52
], - [
- 45,
- 45
], - [
- 38,
- 38
], - [
- 36,
- 36
], - [
- 46,
- 46
], - [
- 51,
- 51
], - [
- 58,
- 58
], - [
- 77,
- 77
], - [
- 58,
- 58
], - [
- 51,
- 51
], - [
- 45,
- 45
]
], - "attributes": {
- "eyes_attributes": {
- "left_eye": {
- "iris_landmarks": [
- [
- 92,
- 92
], - [
- 92,
- 92
], - [
- 93,
- 93
], - [
- 93,
- 93
], - [
- 94,
- 94
], - [
- 95,
- 95
], - [
- 96,
- 96
], - [
- 98,
- 98
], - [
- 99,
- 99
], - [
- 100,
- 100
], - [
- 101,
- 101
], - [
- 102,
- 102
], - [
- 103,
- 103
], - [
- 104,
- 104
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 104,
- 104
], - [
- 103,
- 103
], - [
- 102,
- 102
], - [
- 101,
- 101
], - [
- 100,
- 100
], - [
- 99,
- 99
], - [
- 98,
- 98
], - [
- 97,
- 97
], - [
- 96,
- 96
], - [
- 95,
- 95
], - [
- 94,
- 94
], - [
- 93,
- 93
], - [
- 93,
- 93
]
], - "state": "open"
}, - "right_eye": {
- "iris_landmarks": [
- [
- 152,
- 152
], - [
- 153,
- 153
], - [
- 153,
- 153
], - [
- 154,
- 154
], - [
- 154,
- 154
], - [
- 155,
- 155
], - [
- 157,
- 157
], - [
- 158,
- 158
], - [
- 159,
- 159
], - [
- 161,
- 161
], - [
- 162,
- 162
], - [
- 163,
- 163
], - [
- 164,
- 164
], - [
- 165,
- 165
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 165,
- 165
], - [
- 164,
- 164
], - [
- 163,
- 163
], - [
- 162,
- 162
], - [
- 161,
- 161
], - [
- 159,
- 159
], - [
- 158,
- 158
], - [
- 158,
- 158
], - [
- 157,
- 157
], - [
- 156,
- 156
], - [
- 154,
- 154
], - [
- 154,
- 154
], - [
- 153,
- 153
]
], - "state": "open"
}
}, - "head_pose": {
- "pitch": 12.7464532852,
- "roll": -2.9892115593,
- "yaw": 17.7173442841
}, - "gaze": {
- "yaw": -5.9912848473,
- "pitch": -10.2646684647
}, - "emotions": {
- "predominant_emotion": "neutral",
- "estimations": {
- "anger": 8.682e-7,
- "disgust": 1.0670000000000001e-7,
- "fear": 4.386e-7,
- "happiness": 0.45658952,
- "sadness": 4.951e-7,
- "surprise": 0.0000029291,
- "neutral": 0.543405652
}
}, - "mask": {
- "predominant_mask": "occluded",
- "estimations": {
- "medical_mask": 0.020060448,
- "missing": 0.3235525191,
- "occluded": 0.6563870311
}, - "face_occlusion": {
- "predominant_occlusion": "correct",
- "estimations": {
- "full": 0.019,
- "clear": 0.02,
- "correct": 0.6108324766,
- "partially": 0.31,
- "mouth": 0.0209,
- "chin": 0.019097
}
}
}, - "glasses": {
- "glasses": "no_glasses"
}, - "mouth_attributes": {
- "score": 0.3884400725,
- "occluded": 1.4000000000000001e-9,
- "smile": 0.6115599275,
- "opened": 0.121500025
}, - "basic_attributes": {
- "ethnicities": {
- "predominant_ethnicity": "caucasian",
- "estimations": {
- "asian": 0.0000025556,
- "indian": 6.417e-7,
- "caucasian": 0.9999949932000001,
- "african_american": 0.0000017718000000000001
}
}, - "age": 24,
- "gender": 0
}, - "descriptor": {
- "sdk_descriptor": "ZHAAADgAAAB0k4SAf...IB6gHyAgH19fQ==",
- "score": 0.7854047418000001
}, - "liveness": {
- "prediction": "spoof",
- "estimations": {
- "quality": 1,
- "score": 0.600364089012146
}
}, - "deepfake": {
- "prediction": "fake",
- "score": 0.600364089012146
}
}, - "quality": {
- "blurriness": 0.9769582748000001,
- "dark": 0.9542820454000001,
- "illumination": 0.8248310089,
- "specularity": 0.8472354412,
- "light": 0.8179533482
}, - "warp": "/9j/4AAQSkZJRgABAQAAAQABA..C4gb+KneZD/erEHWn0/asOTzP/9k="
}
}, - "body": {
- "detection": {
- "rect": {
- "x": 32,
- "y": 4,
- "width": 224,
- "height": 255
}, - "warp": "/9j/4AAQSkZJRgABAQAAAQABAA...CX6kdapTi1qS00f/Z",
- "attributes": {
- "descriptor": {
- "sdk_descriptor": "ZHAAAGUAAAC....AfX9",
- "score": 1
}, - "basic_attributes": {
- "apparent_age": 25,
- "apparent_gender": 0
}, - "upper_body": {
- "headwear": {
- "state": 0,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "short"
}, - "upper_clothing": {
- "colors": [
- "white",
- "black"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "trousers",
- "colors": [
- "white",
- "black"
]
}, - "shoes": {
- "apparent_color": "black"
}
}, - "accessories": {
- "backpack": {
- "state": 0
}
}
}
}
}
}
], - "image_estimations": {
- "people": {
- "count": 1,
- "coordinates": [
- [
- 125,
- 125
]
]
}
}
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Request for video analysis based on the specified analytics parameters eg facial estimations.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" |
required | object Video URL. |
required | Array of any A list of parameters for comprehensive video analytics. |
{- "video": {
- "orientation": {
- "angle": 0
}, - "pts": {
- "start_time": 0
}, - "error_handling": {
- "action": "fail"
}
}, - "analytics": [
- {
- "name": "people_count",
- "targets": [ ],
- "parameters": {
- "roi": {
- "x": 3327,
- "y": 3327,
- "width": 3327,
- "height": 3327,
- "mode": "abs"
}, - "droi": {
- "area": [
- [
- {
- "x": 0,
- "y": 0
}, - {
- "x": 0,
- "y": 0
}, - {
- "x": 0,
- "y": 0
}
]
], - "mode": "percent",
- "form": "common"
}, - "rate": {
- "period": 10,
- "unit": "frame"
}, - "probe_count": 3,
- "image_retain_policy": {
- "mimetype": "PNG",
- "quality": 1,
- "max_size": 640
}, - "people_count_threshold": 1
}
}
]
}
{- "video_data": {
- "frames_count": 0,
- "frame_rate": 0,
- "duration": 0,
- "processed_parts": [
- {
- "start_offset": 0,
- "end_offset": 0
}
], - "error_count": 0
}, - "analytics": [
- {
- "name": "people_count",
- "result": {
- "crowd": {
- "events": [
- {
- "event_id": "string",
- "track_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "people_count": 0,
- "video_segment": {
- "start_time_offset": 0.123,
- "end_time_offset": 1.234
}, - "frames_estimations": [
- {
- "people_count": 0,
- "time_offset": 1.234,
- "people_coordinates": [
- [ ]
]
}
], - "overview": {
- "time_offset": 1.234,
- "image": "string",
- "people_coordinates": [
- [
- 530,
- 201
], - [
- 272,
- 191
]
]
}
}
]
}
}
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
The resource performs a visual examination of frontal type images based on ISO/IEC 19794-5 standard. This means that the images that have passed the validation are standardized and attributes of the person's face meet the established requirements. For more information on the requirements for face attributes in the image, see ISO/IEC 19794-5 Clauses 7-10.
The output JSON contains the result of the check for each estimator. The image check is considered successful if the set of these results complies with the ISO standard.
The order of input images is corresponding to elements order in output JSON. If an image is broken, the resource will return an error for this image and other images will be correctly processed.
Notes for incoming data:
image_type | integer Default: 0 Enum: 0 1 Image type of input image. 0 - raw image, 1 - face warped image. |
multiface_policy | integer (iso_multiface_policy) Default: 0 Enum: 0 1 2 multiple face detection policy:
|
extract_exif | integer (extract_exif) Default: 0 Enum: 0 1 Whether to extract EXIF meta information from input JPEG images. Exact output will vary since there are no mandatory requirements for both authoring software and digital cameras how to write the data. This function will only parse the tags and output their names and values as they are. Please refer to JEITA CP-3451 EXIF specification for details. |
Accept | string Enum: "application/json" "application/msgpack" Accept request header. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Enum: "application/json" "multipart/form-data" "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64" |
{- "images": [
- {
- "filename": "raw image",
- "status": 1,
- "error": {
- "error_code": 0,
- "desc": "Success",
- "detail": "Success",
}, - "estimations": [
- {
- "face": {
- "detection": {
- "iso": {
- "status": 1,
- "checks": [
- {
- "name": "image_format",
- "object_value": "JPEG",
- "threshold_value": [
- "JPEG",
- "JPEG2000",
- "PNG"
], - "result": 1
}, - {
- "name": "illumination_quality",
- "object_value": 0.6005162000656128,
- "threshold_value": {
- "min": 0.3,
- "max": 1
}, - "result": 1
}, - {
- "name": "specularity_quality",
- "object_value": 0.7662366628646851,
- "threshold_value": {
- "min": 0.3,
- "max": 1
}, - "result": 1
}, - {
- "name": "blurriness_quality",
- "object_value": 0.9429352283477783,
- "threshold_value": {
- "min": 0.61,
- "max": 1
}, - "result": 1
}, - {
- "name": "dark_quality",
- "object_value": 0.9020983576774597,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "light_quality",
- "object_value": 0.7881984114646912,
- "threshold_value": {
- "min": 0.57,
- "max": 1
}, - "result": 1
}, - {
- "name": "head_yaw",
- "object_value": 2.818983316421509,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_pitch",
- "object_value": 3.816443920135498,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_roll",
- "object_value": 5.434040069580078,
- "threshold_value": {
- "min": -8,
- "max": 8
}, - "result": 1
}, - {
- "name": "gaze_yaw",
- "object_value": -3.773012399673462,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "gaze_pitch",
- "object_value": 0.7140519022941589,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "mouth_smiling",
- "object_value": 0.000290759839117527,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_occluded",
- "object_value": 0.00009619363845558837,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_open",
- "object_value": 0.6226108074188232,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "glasses",
- "object_value": "no_glasses",
- "threshold_value": [
- "no_glasses",
- "eyeglasses"
], - "result": 1
}, - {
- "name": "left_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "right_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "head_horizontal_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.45,
- "max": 0.55
}, - "result": 1
}, - {
- "name": "head_vertical_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.3,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "head_width",
- "object_value": 0.61,
- "threshold_value": {
- "min": 0.5,
- "max": 0.75
}, - "result": 1
}, - {
- "name": "head_height",
- "object_value": 0.71,
- "threshold_value": {
- "min": 0.6,
- "max": 0.9
}, - "result": 1
}, - {
- "name": "eye_distance",
- "object_value": 110,
- "threshold_value": {
- "min": 90,
- "max": null
}, - "result": 1
}, - {
- "name": "eyebrows_state",
- "object_value": "neutral",
- "threshold_value": [
- "neutral"
], - "result": 1
}, - {
- "name": "smile_properties",
- "object_value": "smile_lips",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "headwear_type",
- "object_value": "hat",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "natural_light",
- "object_value": 1,
- "threshold_value": 1,
- "result": 1
}, - {
- "name": "radial_distortion",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "red_eyes",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "face_color_type",
- "object_value": "color",
- "threshold_value": [
- "color"
], - "result": 1
}, - {
- "name": "background_lightness",
- "object_value": 0.5780888795852661,
- "threshold_value": {
- "min": 0.2,
- "max": 1
}, - "result": 1
}, - {
- "name": "background_uniformity",
- "object_value": 0.8874394297599792,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "shoulders_position",
- "object_value": "parallel",
- "threshold_value": [
- "parallel"
], - "result": 1
}
]
}, - "rect": {
- "x": 108,
- "y": 58,
- "width": 113,
- "height": 165
}
}
}
}
]
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Detect faces in input images, create samples, and estimate face properties.
Detections can be filtered out by head pose. The pose is defined by yaw, pitch and roll angles.
To specify a filtering threshold per-angle, use corresponding query parameters
(yaw_threshold
, pitch_threshold
and roll_threshold
). By default no filtering is applied.
The estimated face properties are not saved to the Faces database. They are only returned in the response.
Samples are saved in the storage without the ability to disable saving. You can disable the saving of samples only using the handlers.
Notes for incoming data:
multiface_policy | integer (multiface_policy) Default: 1 Enum: 0 1 2 Multiple face detection policy:
|
estimate_head_pose | integer (estimate_head_pose) Default: 0 Enum: 0 1 Whether to estimate head pose in the image. The head pose is represented by pitch, yaw and roll angles. Not supported with warped images (see |
estimate_emotions | integer (estimate_emotions) Default: 0 Enum: 0 1 Whether to estimate emotions in the image. The probability of the following emotions is estimated: "anger", "disgust", "fear", "happiness", "sadness", "surprise", "neutral". |
estimate_mask | integer (estimate_mask) Default: 0 Enum: 0 1 Whether to estimate mask in the image. The probability of the following masks states is estimated: "medical_mask", "missing", "occluded". The estimated probability with the highest score is returned in the "predominant mask" parameter. |
detect_landmarks68 | integer (detect_landmarks68) Default: 0 Enum: 0 1 Whether to detect basic 68-point facial landmarks in the image.
Not supported with warped images (see |
extract_exif | integer (extract_exif) Default: 0 Enum: 0 1 Whether to extract EXIF meta information from input JPEG images. Exact output will vary since there are no mandatory requirements for both authoring software and digital cameras how to write the data. This function will only parse the tags and output their names and values as they are. Please refer to JEITA CP-3451 EXIF specification for details. |
estimate_quality | integer (estimate_quality) Default: 0 Enum: 0 1 Whether to estimate input face image quality. Each of the following probabilities is estimated: "darkness", "light", "blurriness", "illumination", "specularity". The quality factor is estimated for each probability. It's value is in the range [0..1] where 0 corresponds to low quality and 1 to high quality. Note. Face recognition is not greatly affected by uneven illumination or high specularity. |
estimate_gaze | integer (estimate_gaze) Default: 0 Enum: 0 1 Whether to estimate gaze in the image. The gaze is represented by yaw angle and pitch angle for both eyes at once. Not supported with warped images (see |
estimate_eyes_attributes | integer (estimate_eyes_attributes) Default: 0 Enum: 0 1 Whether to estimate eye attributes in the image. The "right_eye" and "left_eye" parameters are estimated, which contain the "state" (opened, closed or occluded) and "iris_landmarks" parameters. |
estimate_mouth_attributes | integer (estimate_mouth_attributes) Default: 0 Enum: 0 1 Whether to estimate mouth attributes in the image. Each of the following probabilities is estimated: "opened", "occluded", "smile", "score". |
pitch_threshold | integer (pitch_threshold) [ 0 .. 180 ] Example: pitch_threshold=180 Maximum deviation pitch angle from 0. If the estimated value is equal or less than the threshold, the image is filtered. Remove this parameter from the query, or set the parameter value to 180 if pitch angle filtration is not required. When the value is set to "0", all the images are filtered. |
roll_threshold | integer (roll_threshold) [ 0 .. 180 ] Example: roll_threshold=180 Maximum deviation roll angle from 0. If the estimated value is equal or less than the threshold, the image is filtered. Remove this parameter from the query, or set the parameter value to 180 if roll angle filtration is not required. When the value is set to "0", all the images are filtered. |
yaw_threshold | integer (yaw_threshold) [ 0 .. 180 ] Example: yaw_threshold=180 Maximum deviation yaw angle from 0. If the estimated value is equal or less than the threshold, the image is filtered. Remove this parameter from the query, or set the parameter value to 180 if yaw angle filtration is not required. When the value is set to "0", all the images are filtered. |
warped_image | integer (warped_image) Default: 0 Enum: 0 1 Whether an input image is a sample or not. |
use_exif_info | integer Default: 1 Enum: 0 1 Example: use_exif_info=1 Whether to try to auto orient image based on EXIF data. The processed image should have EXIF data, otherwise auto orientation will not be performed. Has no effect with tiff images (they're always auto oriented). Ignored with warped images (see |
estimate_face_quality | integer Default: 0 Enum: 0 1 Whether to estimate face quality. It enables you to perform various face quality checks by thresholds which similar to ISO standard. For more information on the requirements for face attributes in the image, see ISO/IEC 19794-5 Clauses 7-10. âš ISO licensing feature is required to be enabled to perform face quality estimation. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Enum: "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "multipart/form-data" "application/json" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64" |
{- "images": [
- {
- "filename": "face_1.jpg",
- "error": {
- "error_code": 0,
- "desc": "Success",
- "detail": "Success",
}, - "status": 1,
- "detections": {
- "samples": [
- {
- "face": {
- "detection": {
- "rect": {
- "x": 594,
- "y": 181,
- "width": 678,
- "height": 963
}, - "landmarks5": [
- [
- 169,
- 169
], - [
- 454,
- 454
], - [
- 325,
- 325
], - [
- 227,
- 227
], - [
- 466,
- 466
]
], - "quality": {
- "blurriness": 0.9740276337,
- "dark": 0.9211971164,
- "illumination": 0.8751303554,
- "specularity": 0.9605293274,
- "light": 0.8855836391
}, - "attributes": {
- "mouth_attributes": {
- "opened": 0.021500025,
- "occluded": 0.9998804331,
- "smile": 0,
- "score": 1
}, - "head_pose": {
- "pitch": 6.7033782005,
- "roll": -6.140639782,
- "yaw": 3.3139002323
}, - "gaze": {
- "yaw": 0.281270504,
- "pitch": -1.0716878176
}
}
}, - "url": "/6/samples/faces/f9285806-371e-4c61-be00-0424029856e3",
- "sample_id": "50cccef8-3ea8-42a0-8e6d-68b90ee148f6"
}
}
], - "filtered_detections": {
- "face_detections": [ ]
}
}
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Save face or body sample to the storage.
samples_type required | string Enum: "faces" "bodies" Samples type. |
ttl | integer Enum: 1 2 3 4 5 6 7 14 30 60 90 180 365 -1 Example: ttl=1 Lifetime for object, in days. By default, parent bucket lifetime configuration applied. For object to be retained indefinitely, setup |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Enum: "image/jpeg" "image/png" "image/bmp" "image/tiff" "image/x-portable-pixmap" |
Image generated by VisionLabs algorithms.
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("face_warp.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/samples/faces" response = requests.post(url, data=image, headers=headers) print(response.status_code) print(response.json())
{- "sample_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "url": "/6/samples/bodies/b5d6fd45-fcca-453d-ac05-3e594054b813"
}
Get options for the resource.
samples_type required | string Enum: "faces" "bodies" Samples type. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get face or body sample by ID.
Returns its lifetime in X-Luna-Expiry-Date
header.
samples_type required | string Enum: "faces" "bodies" Samples type. |
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create sample headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("face_warp.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/samples/faces" sampleId = requests.post(url, data=image, headers=headers).json()["sample_id"] # get sample headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/samples/faces/{sampleId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Check if face or body sample with sample_id
exists.
Returns its lifetime in X-Luna-Expiry-Date
header.
samples_type required | string Enum: "faces" "bodies" Samples type. |
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create sample headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("face_warp.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/samples/faces" sampleId = requests.post(url, data=image, headers=headers).json()["sample_id"] # get sample headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/samples/faces/{sampleId}" response = requests.head(url, headers=headers) print(response.status_code)
Remove face or body sample by ID.
samples_type required | string Enum: "faces" "bodies" Samples type. |
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create sample headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("face_warp.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/samples/faces" sampleId = requests.post(url, data=image, headers=headers).json()["sample_id"] # get sample headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/samples/faces/{sampleId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Get options for the resource.
samples_type required | string Enum: "faces" "bodies" Samples type. |
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 13003,
- "desc": "Object not found",
- "detail": "Image with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found",
}
Get sample by ID using previous API version.
Returns its lifetime in X-Luna-Expiry-Date
header.
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Check if face or body sample with sample_id
exists using previous API version.
Returns its lifetime in X-Luna-Expiry-Date
header.
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Remove sample by ID using previous API version.
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Get options for the resource using previous API version.
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 13003,
- "desc": "Object not found",
- "detail": "Image with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found",
}
Get a face sample by ID.
Returns its lifetime in X-Luna-Expiry-Date
header.
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Check if face sample with sample_id
exists.
Returns its lifetime in X-Luna-Expiry-Date
header.
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Remove sample by ID.
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Get options for the resource.
sample_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 13003,
- "desc": "Object not found",
- "detail": "Image with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found",
}
Save images with unique ID.
ttl | integer Enum: 1 2 3 4 5 6 7 14 30 60 90 180 365 -1 Example: ttl=1 Lifetime for object, in days. By default, parent bucket lifetime configuration applied. For object to be retained indefinitely, setup |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Enum: "image/jpeg" "image/png" "image/bmp" "image/tiff" "image/x-portable-pixmap" Type of transferring image. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
* (X-Luna-Meta-<user_defined_key>) | string Example: <user_defined_value> User-defined image metadata key-value. To store metadata values for multiple keys, the multiple headers should be defined. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("face_warp.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/images" response = requests.post(url, data=image, headers=headers) print(response.status_code) print(response.json())
{- "image_id": "141d2706-8baf-433b-82eb-8c7fada847da",
- "url": "/6/images/141d2706-8baf-433b-82eb-8c7fada847da",
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Check if image with image_id
exists.
Returns its lifetime in X-Luna-Expiry-Date
header.
image_id required | string <uuid> (image_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Image ID. |
with_meta | integer Default: 0 Enum: 0 1 Example: with_meta=1 Whether to retrieve user-defined image metadata. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create sample headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("face_warp.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/images" imageId = requests.post(url, data=image, headers=headers).json()["image_id"] # get image headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/images/{imageId}" response = requests.head(url, headers=headers) print(response.status_code)
Delete an image.
image_id required | string <uuid> (image_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Image ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create sample headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("face_warp.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/images" imageId = requests.post(url, data=image, headers=headers).json()["image_id"] # get image headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/images/{imageId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Receive an origin image.
Returns its lifetime in X-Luna-Expiry-Date
header.
image_id required | string <uuid> (image_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Image ID. |
with_meta | integer Default: 0 Enum: 0 1 Example: with_meta=1 Whether to retrieve user-defined image metadata. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create sample headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("face_warp.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/images" imageId = requests.post(url, data=image, headers=headers).json()["image_id"] # get image headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/images/{imageId}" response = requests.get(url, headers=headers) print(response.status_code)
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Get options for the resource.
image_id required | string <uuid> (image_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Image ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Save object with unique ID.
ttl | integer Enum: 1 2 3 4 5 6 7 14 30 60 90 180 365 -1 Example: ttl=1 Lifetime for object, in days. By default, parent bucket lifetime configuration applied. For object to be retained indefinitely, setup |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type required | string Type of transferring information.
|
Some user defined bytes. The service saves the bytes as is
.
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "text/plain", } url = f"{baseUri}/objects" response = requests.post(url, data="example", headers=headers) print(response.status_code) print(response.json())
{- "object_id": "141d2706-8baf-433b-82eb-8c7fada847da",
- "url": "/6/objects/141d2706-8baf-433b-82eb-8c7fada847da",
}
Get options for the resource.
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Receiving objects.
Returns its lifetime in X-Luna-Expiry-Date
header.
object_id required | string <uuid> (object_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Object ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create objects headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "text/plain", } url = f"{baseUri}/objects" objectId = requests.post(url, data="example", headers=headers).json()["object_id"] # get object headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/objects/{objectId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.text)
{- "error_code": 12017,
- "detail": "Bad/incomplete input data",
- "desc": "Bad content type",
}
Check if object with object_id
exists.
Returns its lifetime in X-Luna-Expiry-Date
header.
object_id required | string <uuid> (object_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Object ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create object headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "text/plain", } url = f"{baseUri}/objects" objectId = requests.post(url, data="example", headers=headers).json()["object_id"] # check objects headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/objects/{objectId}" response = requests.head(url, headers=headers) print(response.status_code)
Delete object
object_id required | string <uuid> (object_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Object ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create object headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "text/plain", } url = f"{baseUri}/objects" objectId = requests.post(url, data="example", headers=headers).json()["object_id"] # get object headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/objects/{objectId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Get options for the resource.
object_id required | string <uuid> (object_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Object ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Extract descriptors and basic attributes from samples.
All the extracted attributes are temporary.
Temporary attributes have a TTL (time to live) and will be removed from the database after the specified period.
score_threshold | number (score_threshold) [ 0 .. 1 ] Default: 0 Example: score_threshold=0.7 Descriptor quality score threshold. The higher the quality score for the image, the better the extraction results. All the attributes with a quality score below the threshold will be ignored (and not stored in the DB). The function will proceed as usual with all the remaining descriptors (if left). Consult VisionLabs about the recommended value of this parameter. Note! This parameter is not related to the image quality estimated in the detect request ( |
extract_descriptor | integer (extract_descriptor) Default: 1 Enum: 0 1 Example: extract_descriptor=1 Whether to extract face descriptor(s). |
extract_basic_attributes | integer (extract_basic_attributes) Default: 0 Enum: 0 1 Whether to extract basic attributes (gender, age, ethnicity). |
aggregate_attributes | integer (aggregate_attributes) Whether to aggregate face attributes (descriptor and basic attributes). Aggregation will only be performed together with the If set, all extracted attributes from each image will be aggregated and stored as single objects. Otherwise, all extracted attributes from each image will be stored for each sample as separate objects. |
ttl | integer [ 1 .. 86400 ] Default: 300 Lifetime for temporary attribute (seconds). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
Sample ID.
[- "f9f03668-27e3-4e23-9b55-681e5927905e",
- "4967ccb7-b521-43b5-93ba-a0d266631bb2",
- "dd98cf9c-ddf3-4962-a3c5-e8bd540a4fc7"
]
[- {
- "samples": [
- "f9f03668-27e3-4e23-9b55-681e5927905e"
], - "attribute_id": "3917e7a6-2f62-4151-905a-a5d786fcaf0b",
- "url": "/6/attributes/3917e7a6-2f62-4151-905a-a5d786fcaf0b",
- "basic_attributes": {
- "ethnicities": {
- "predominant_ethnicity": "caucasian",
- "estimations": {
- "asian": 9.823425273225439e-8,
- "indian": 0.000015799123502802104,
- "caucasian": 0.9999819993972778,
- "african_american": 0.000002058620793832233
}
}, - "age": 19,
- "gender": 0
}, - "score": 0.9949966669082642
}, - {
- "samples": [
- "4967ccb7-b521-43b5-93ba-a0d266631bb2"
], - "attribute_id": "87737317-9c75-46b3-a0cc-6cd2b258e027",
- "url": "/6/attributes/87737317-9c75-46b3-a0cc-6cd2b258e027",
- "basic_attributes": {
- "ethnicities": {
- "predominant_ethnicity": "caucasian",
- "estimations": {
- "asian": 0.000002390194367762888,
- "indian": 1.3357706052374851e-8,
- "caucasian": 0.9999673366546631,
- "african_american": 0.000030240154956118204
}
}, - "age": 23,
- "gender": 0
}, - "score": 0.998572826385498
}, - {
- "samples": [ ],
- "attribute_id": null,
- "url": null,
- "external_url": null,
- "filter": {
- "is_filtered": true,
- "filter_reasons": [
- {
- "filter_name": "score_threshold",
- "object_value": 0.8610286712646484,
- "threshold_value": 0.9
}
]
}
}
]
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
New temporary attributes creation.
Note. Use this request when you need to add basic attributes or descriptors from external storage. Otherwise, use the extract attributes request.
All the extracted attributes are temporary.
Temporary attributes have a TTL (time to live) and will be removed from the database after the specified period.
ttl | integer [ 1 .. 86400 ] Default: 300 Lifetime for temporary attribute (seconds). |
Content-Type | string Enum: "application/json" "multipart/form-data" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
required | Array of descriptor_data (object) or sdk_descriptor (string) (face_descriptors) non-empty List of descriptors with versions. Each descriptor is aggregated from the provided samples. |
face_descriptor_samples | Array of strings <uuid> (attributes_samples) >= 0 items unique Default: [] List of uniqie sample IDs which are resources for the estimated attributes.
|
required | object (basic_attributes_without_defaults) Basic attributes. |
basic_attributes_samples | Array of strings <uuid> (attributes_samples) >= 0 items unique Default: [] List of uniqie sample IDs which are resources for the estimated attributes.
|
{- "face_descriptors": [
- {
- "descriptor": "2xQ2gprbMUePw1s9gw9fvA==",
- "version": 46
}, - {
- "descriptor": "1xWqdsdwew32fsdsdw1s9gw9fvA==",
- "version": 56
}
], - "face_descriptor_samples": [
- "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
- "e909cfbe-29d3-44ed-a949-6cb700b89eba"
], - "basic_attributes": {
- "age": 29,
- "gender": 0,
- "ethnicity": 4
}, - "basic_attributes_samples": [
- "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
- "e909cfbe-29d3-44ed-a949-6cb700b89eba"
]
}
{- "attribute_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "url": "/6/attributes/b5d6fd45-fcca-453d-ac05-3e594054b813",
}
Get temporary attributes by IDs.
For each attribute:
If the attribute TTL has not expired, the attribute data is returned.
If the TTL has expired, no data is returned for this attribute in the response.
attribute_ids required | Array of strings <uuid> (uuid) Example: attribute_ids=557d54ec-29ad-4f3c-93b4-c9092ef12515 Comma-separated list of attribute IDs. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
targets | Array of strings Default: ["create_time","attribute_id","account_id","face_descriptor_samples","basic_attributes_samples","face_descriptor","basic_attributes_samples"] Items Enum: "create_time" "attribute_id" "account_id" "basic_attributes" "face_descriptor_samples" "basic_attributes_samples" "face_descriptor" "basic_attributes_samples" Example: targets=basic_attributes,basic_attributes_samples,account_id Comma-separated list of temporary attributes targets. All targets are available by default. |
descriptor_version | integer (descriptor_version) Enum: 46 52 54 56 57 58 59 60 62 64 65 Example: descriptor_version=56 Descriptor version returned in the response. By default, the LUNA PLATFORM default descriptor version is used. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create attribute headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "basic_attributes": { "age": 29, "gender": 0, "ethnicity": 3, }, } url = f"{baseUri}/attributes" attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"] # get attributes headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } params = { "attribute_ids": [ attributeId, ], "targets": "basic_attributes,basic_attributes_samples,account_id", } url = f"{baseUri}/attributes" response = requests.get( url, headers=headers, params=params ) print(response.status_code) print(response.json())
{- "attributes": [
- {
- "basic_attributes": {
- "age": 29,
- "gender": 0,
- "ethnicity": 4
}, - "face_descriptor_samples": [
- "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
- "e909cfbe-29d3-44ed-a949-6cb700b89eba"
], - "basic_attributes_samples": [
- "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
- "e909cfbe-29d3-44ed-a949-6cb700b89eba"
], - "attribute_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "account_id": "string",
- "create_time": "string"
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get temporary attribute by ID.
If the attribute TTL has not expired, the attribute data is returned.
Otherwise, the "Attributes not found" error is returned.
attribute_id required | string <uuid> (attribute_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the temporary attribute. |
descriptor_version | integer (descriptor_version) Enum: 46 52 54 56 57 58 59 60 62 64 65 Example: descriptor_version=56 Descriptor version returned in the response. By default, the LUNA PLATFORM default descriptor version is used. |
targets | Array of strings Default: ["create_time","attribute_id","account_id","face_descriptor_samples","basic_attributes_samples","face_descriptor","basic_attributes_samples"] Items Enum: "create_time" "attribute_id" "account_id" "basic_attributes" "face_descriptor_samples" "basic_attributes_samples" "face_descriptor" "basic_attributes_samples" Example: targets=basic_attributes,basic_attributes_samples,account_id Comma-separated list of temporary attributes targets. All targets are available by default. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create attribute headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "basic_attributes": { "age": 29, "gender": 1, "ethnicity": 3, }, } url = f"{baseUri}/attributes" attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"] # get attributes headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/attributes/{attributeId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "create_time": "2021-08-11T14:57:18.416928+03:00",
- "attribute_id": "7fdf9225-3c06-4c21-b774-8bea99bcce20",
- "account_id": "0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c",
- "face_descriptor_samples": [
- "0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c",
- "2f1cbb34-12e5-486c-8f7f-57273053c32d"
], - "basic_attributes_samples": [
- "00000000-0000-4000-8000-000000000000"
], - "face_descriptor": "2xQ2gprbMUePw1s9gw9fvA==",
- "basic_attributes": {
- "age": 33,
- "gender": 1,
- "ethnicity": 3
}
}
Check if temporary attribute with attribute_id
exists.
attribute_id required | string <uuid> (attribute_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the temporary attribute. |
descriptor_version | integer (descriptor_version) Enum: 46 52 54 56 57 58 59 60 62 64 65 Example: descriptor_version=56 Descriptor version returned in the response. By default, the LUNA PLATFORM default descriptor version is used. |
targets | Array of strings Default: ["create_time","attribute_id","account_id","face_descriptor_samples","basic_attributes_samples","face_descriptor","basic_attributes_samples"] Items Enum: "create_time" "attribute_id" "account_id" "basic_attributes" "face_descriptor_samples" "basic_attributes_samples" "face_descriptor" "basic_attributes_samples" Example: targets=basic_attributes,basic_attributes_samples,account_id Comma-separated list of temporary attributes targets. All targets are available by default. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create attribute headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "basic_attributes": { "age": 29, "gender": 1, "ethnicity": 3, }, } url = f"{baseUri}/attributes" attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"] # get attributes headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/attributes/{attributeId}" response = requests.head(url, headers=headers) print(response.status_code)
Delete the attribute by its ID.
attribute_id required | string <uuid> (attribute_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the temporary attribute. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests # create attribute headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "basic_attributes": { "age": 29, "gender": 1, "ethnicity": 3, }, } url = "http://127.0.0.1:5000/6/attributes" attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"] # get attributes headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"http://127.0.0.1:5000/6/attributes/{attributeId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Get options for the resource.
attribute_id required | string <uuid> (attribute_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the temporary attribute. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get all the temporary attribute samples by the attribute ID.
If the attribute TTL has not expired, the attribute data is returned.
Otherwise, the "Attributes not found" error is returned.
attribute_id required | string <uuid> (attribute_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the temporary attribute. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create sample headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("image.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/detector" sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"] # exreact attr # create attribute headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "basic_attributes": { "age": 29, "gender": 1, "ethnicity": 3, }, "basic_attributes_samples": [ sampleId, ], } url = f"{baseUri}/attributes" attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"] # get attributes by id headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/attributes/{attributeId}/samples" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "samples": [
- "0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c",
- "2f1cbb34-12e5-486c-8f7f-57273053c32d"
]
}
Get options for the resource.
attribute_id required | string <uuid> (attribute_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the temporary attribute. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a face.
The face can be attached to one or several lists.
You can create new face using a temporary attribute ID or using external attribute data (descriptors and/or basic attributes).
You can also create the face without any attributes specified.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Enum: "application/json" "application/msgpack" Format of a request body data. |
attribute_set_by_attribute_id (object) or (attribute_no_account (attribute_with_descriptors_and_basic_attributes_no_account (object) or attribute_with_basic_attributes_no_account (object) or attribute_with_descriptors_no_account (object))) (face_attribute) Face attributes. You can specify attributes for the face using one of several ways:
The last three ways are used when you need to create the face using data stored in external storage. | |
external_id | string (face_external_id) <= 36 characters Default: "" User-defined external ID for the face. External ID can be used to link several faces which belong to one person. |
user_data | string (face_user_data) <= 128 characters Default: "" User data associated with face. |
avatar | string <uri-reference> (avatar) <= 256 characters Default: "" Avatar is a visual representation of the face. The avatar can be used in the user interface. You can use a sample or an external image as the avatar. |
lists | Array of strings <uuid> (list_id) non-empty Lists for linking face with them. |
event_id | string <uuid> (event_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... The event ID associated with the face creation. |
{- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "attribute": {
- "attribute_id": "b4a40d88-8998-4e19-8cc8-be894a1ceb5e"
}, - "user_data": "some_string",
- "lists": [
- "234fc28c-a767-42fc-a0c2-e01ad00b5c59",
- "c2a09aff-0116-41cf-a7c7-91631d40d0c2"
], - "event_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515"
}
{- "face_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "url": "/6/faces/b5d6fd45-fcca-453d-ac05-3e594054b813",
}
Get faces according to filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. |
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. |
event_id | string <uuid> (event_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: event_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Event ID associated with the face creation. |
face_id__lt | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: face_id__lt=8950722f-3fd4-4223-b48f-03f95f0e8dfb Face ID upper excluded bound. Faces in response will be sorted by their ids. If neither face_id__lt or face_id__gte is specified, the faces will be sorted by creation time. |
face_id__gte | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: face_id__gte=8950722f-3fd4-4223-b48f-03f95f0e8dfb Face ID lower included bound. Faces in response will be sorted by their ids. If neither face_id__lt or face_id__gte is specified, the faces will be sorted by creation time. |
face_ids | Array of strings <uuid> (uuid) Example: face_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of face IDs. |
external_ids | Array of strings <uuid> (uuid) Example: external_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of external IDs. |
user_data | string Example: user_data=user_data_text Find all objects with |
list_id | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: list_id=557d54ec-29ad-4f3c-93b4-c9092ef12515 List ID that contains faces. |
targets | Array of strings (faces_targets) Items Enum: "face_id" "account_id" "event_id" "user_data" "create_time" "external_id" "avatar" "lists" Example: targets=face_id,user_data Comma-separated list of face fields. If set, each face from result will contain only specified fields, otherwise, faces with all the fields will be returned. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces" params = { "create_time__gte": "2018-08-11T09:11:41.674Z", "user_data": "face", "targets": "face_id,account_id,event_id,user_data,create_time", } response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "faces": [
- {
- "face_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "account_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "event_id": "f9687459-986b-406d-9c1f-0d6289be5256",
- "user_data": "fox1991",
- "create_time": "2018-08-11T09:11:41.674Z",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "lists": [
- "429b0e78-4616-426a-b57f-02baa72d638d",
- "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
]
}
]
}
Delete several faces by IDs.
When the faces are removed, attributes (descriptors and basic attributes) linked to the faces are deleted. Samples linked to the faces are not deleted.
If you need to delete faces according to some filters and with all samples,
you can use the "garbage collection task" with target = faces
and remove_samples
flag enabled.
ignore | integer (int01) Default: 0 Enum: 0 1 Whether to ignore the error if the face to be deleted does not exist. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
face_ids required | Array of strings <uuid> (face_id) non-empty Comma-separated list of face IDs for removal. |
{- "face_ids": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
]
}
{- "error_code": 12022,
- "desc": "Bad/incomplete input data",
- "detail": "Failed to validate input json. Path: '', message: 'Additional properties are not allowed ('faces' was unexpected)'",
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Count faces according to the filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. |
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. |
face_ids | Array of strings <uuid> (uuid) Example: face_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of face IDs. |
face_id__lt | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: face_id__lt=8950722f-3fd4-4223-b48f-03f95f0e8dfb Face ID upper excluded bound. |
face_id__gte | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: face_id__gte=8950722f-3fd4-4223-b48f-03f95f0e8dfb Face ID lower included bound. |
event_id | string <uuid> (event_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: event_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Event ID associated with the face creation. |
external_ids | Array of strings <uuid> (uuid) Example: external_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of external IDs. |
user_data | string Example: user_data=user_data_text Find all objects with |
list_id | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: list_id=557d54ec-29ad-4f3c-93b4-c9092ef12515 List ID that contains faces. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces/count" params = { "create_time__gte": "2018-08-11T09:11:41.674Z", "user_data": "face", } response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "faces_count": 7
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Count faces with attributes.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces/attributes/count" response = requests.get( url, headers=headers, ) print(response.status_code) print(response.json())
{- "faces_count": 7
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get face by ID.
face_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the face (face_id received in the "create face" request). |
targets | Array of strings (faces_targets) Items Enum: "face_id" "account_id" "event_id" "user_data" "create_time" "external_id" "avatar" "lists" Example: targets=face_id,user_data Comma-separated list of face fields. If set, each face from result will contain only specified fields, otherwise, faces with all the fields will be returned. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces" faceId = requests.post(url, headers=headers).json()["face_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces/{faceId}" response = requests.get( url, headers=headers, ) print(response.status_code) print(response.json())
{- "face_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "account_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "event_id": "f9687459-986b-406d-9c1f-0d6289be5256",
- "user_data": "fox1991",
- "create_time": "2018-08-11T09:11:41.674Z",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "lists": [
- "429b0e78-4616-426a-b57f-02baa72d638d",
- "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
]
}
Update face fields: user_data
, external_id
, event_id
, avatar
.
face_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the face (face_id received in the "create face" request). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
external_id | string <= 36 characters User-defined external ID for the face. |
event_id | string or null <uuid> (event_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Event ID. |
user_data | string <= 128 characters User data associated with face. |
avatar | string <uri-reference> (avatar) <= 256 characters Default: "" Avatar is a visual representation of the face. The avatar can be used in the user interface. You can use a sample or an external image as the avatar. |
{- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "user_data": "some_string",
}
{- "error_code": 12022,
- "desc": "Bad/incomplete input data",
- "detail": "Failed to validate input json. Path: '', message: 'Additional properties are not allowed ('userdata' was unexpected)'",
}
Remove face by ID.
When the face is removed, attributes (descriptors and basic attributes) linked to the face are deleted.
Samples linked to the face are not deleted. If there are a small number of samples for face, then you can use the resources
"get face attribute samples" >
"remove face/body sample" > "delete face" (this resource). If you need to delete faces according to some filters and with all samples,
you can use the "garbage collection task" with target = faces
and remove_samples
flag enabled.
face_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the face (face_id received in the "create face" request). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/faces" faceId = requests.post( url, headers=headers, ).json()["face_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces/{faceId}" response = requests.delete( url, headers=headers, ) print(response.status_code)
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Check if face with face_id
exists.
face_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the face (face_id received in the "create face" request). |
targets | Array of strings (faces_targets) Items Enum: "face_id" "account_id" "event_id" "user_data" "create_time" "external_id" "avatar" "lists" Example: targets=face_id,user_data Comma-separated list of face fields. If set, each face from result will contain only specified fields, otherwise, faces with all the fields will be returned. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces" faceId = requests.post( url, headers=headers, ).json()["face_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces/{faceId}" response = requests.head( url, headers=headers, ) print(response.status_code)
Get options for the resource.
face_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the face (face_id received in the "create face" request). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Put face attribute.
This request changes all the attribute data corresponding to the specified face.
The attribute can be specified by temporary attribute ID or using external attribute data (descriptors and/or basic attributes).
face_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the face ( |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
attribute_id required | string <uuid> (attribute_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Attribute ID. This ID links the descriptor, basic attributes, and samples extracted from a single image. |
{- "attribute_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
{- "error_code": 12022,
- "desc": "Bad/incomplete input data",
- "detail": "Failed to validate input json. Path: '', message: 'Additional properties are not allowed ('userdata' was unexpected)'",
}
Get face attribute by ID.
face_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the face ( |
descriptor_format | integer Default: "raw" Enum: "raw" "sdk" Output descriptor format. Note that |
targets | Array of strings Default: "create_time,basic_attributes,basic_attributes_samples,face_descriptor,face_descriptor_samples" Items Enum: "create_time" "basic_attributes" "basic_attributes_samples" "face_descriptor" "face_descriptor_samples" Comma-separated list of temporary attributes targets. Available targets:
|
descriptor_version | integer (descriptor_version) Enum: 46 52 54 56 57 58 59 60 62 64 65 Example: descriptor_version=56 Descriptor version returned in the response. By default, the LUNA PLATFORM default descriptor version is used. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests import base64 baseUri = "http://127.0.0.1:5000/6" # create sample headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("image.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/detector" sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"] # create attribute with open("descriptor56", "rb") as file: descriptor = base64.b64encode(file.read()).decode() headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } params = { "ttl": 600, } payload = { "basic_attributes": { "age": 29, "gender": 0, "ethnicity": 3, }, "basic_attributes_samples": [ sampleId, ], "face_descriptor_samples": [ sampleId, ], "face_descriptors": [ {"descriptor": descriptor, "version": 56}, ], } url = f"{baseUri}/attributes" attributeId = requests.post( url, json=payload, headers=headers, params=params ).json()["attribute_id"] # create face payload = { "external_id": "2xQ2gprbMUePw1s9gw9fvA==", "attribute": {"attribute_id": attributeId}, } headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/faces" faceId = requests.post( url, headers=headers, json=payload, ).json()["face_id"] # get face attribute by ID headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces/{faceId}/attributes" response = requests.get( url, headers=headers, ) print(response.status_code) print(response.json())
{- "attributes": {
- "create_time": "2018-08-11T09:11:41.674Z",
- "basic_attributes": {
- "age": 29,
- "gender": 1,
- "ethnicity": 2
}, - "face_descriptor": {
- "descriptor": "byte string",
- "descriptor_version": 56
}, - "basic_attributes_samples": [
- "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
- "e909cfbe-29d3-44ed-a949-6cb700b89eba"
], - "face_descriptor_samples": [
- "951de511-7ef5-4ed9-9c06-dcfbb399712e",
- "3c3a83c2-c21e-4855-91b5-34e6b63fb12d"
]
}
}
Remove face attribute by ID.
face_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the face ( |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests import base64 baseUri = "http://127.0.0.1:5000/6" # create sample headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("image.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/detector" sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"] # create attribute with open("descriptor56", "rb") as file: descriptor = base64.b64encode(file.read()).decode() headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } params = { "ttl": 600, } payload = { "basic_attributes": { "age": 29, "gender": 0, "ethnicity": 3, }, "basic_attributes_samples": [ sampleId, ], "face_descriptor_samples": [ sampleId, ], "face_descriptors": [ {"descriptor": descriptor, "version": 56}, ], } url = f"{baseUri}/attributes" attributeId = requests.post( url, json=payload, headers=headers, params=params ).json()["attribute_id"] payload = { "external_id": "2xQ2gprbMUePw1s9gw9fvA==", "attribute": {"attribute_id": attributeId}, } # create face headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/faces" faceId = requests.post( url, headers=headers, json=payload, ).json()["face_id"] # get face attribute by ID headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces/{faceId}/attributes" response = requests.delete( url, headers=headers, ) print(response.status_code)
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Get options for the resource.
face_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the face ( |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get face attribute samples by face ID.
face_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the face ( |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests import base64 baseUri = "http://127.0.0.1:5000/6" # create sample headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", } with open("image.jpg", "rb") as image_file: image = image_file.read() url = f"{baseUri}/detector" sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"] # create attribute with open("descriptor56", "rb") as file: descriptor = base64.b64encode(file.read()).decode() headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } params = { "ttl": 600, } payload = { "basic_attributes": { "age": 29, "gender": 0, "ethnicity": 3, }, "basic_attributes_samples": [ sampleId, ], "face_descriptor_samples": [ sampleId, ], "face_descriptors": [ {"descriptor": descriptor, "version": 56}, ], } url = f"{baseUri}/attributes" attributeId = requests.post( url, json=payload, headers=headers, params=params ).json()["attribute_id"] # create face payload = { "external_id": "2xQ2gprbMUePw1s9gw9fvA==", "attribute": {"attribute_id": attributeId}, } headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces" faceId = requests.post( url, headers=headers, json=payload, ).json()["face_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/faces/{faceId}/attributes/samples" response = requests.get( url, headers=headers, ) print(response.status_code) print(response.json())
{- "samples": [
- "0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c",
- "2f1cbb34-12e5-486c-8f7f-57273053c32d"
]
}
Get options for the resource.
face_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the face ( |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a list.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
user_data | string (list_user_data) <= 128 characters Default: "" User data associated with list. |
{- "user_data": "list of good persons"
}
{- "list_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "url": "/6/lists/b5d6fd45-fcca-453d-ac05-3e594054b813",
}
Get lists according to the filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for list create_time. |
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for list create_time. |
last_update_time__lt | string <date-time> (time) Example: last_update_time__lt=2018-08-11T09:11:41.674Z Upper excluded bound for list last_update_time. |
last_update_time__gte | string <date-time> (time) Example: last_update_time__gte=2018-08-11T09:11:41.674Z Lower included bound for list last_update_time. |
user_data | string Example: user_data=user_data_text Find all objects with |
user_data__eq | string Example: user_data__eq=user_data_text Find all objects with same |
list_ids | Array of strings Comma-separated list of list IDs. |
list_id__lt | string <uuid> List ID upper excluding boundary. |
list_id__gte | string <uuid> List ID lower including boundary. |
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" params = { "user_data": "good", "page_size": 20, "create_time__gte": "2020-10-10T09:11:41.674Z", } headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/lists" response = requests.get(url, params=params, headers=headers) print(response.status_code) print(response.json())
{- "lists": [
- {
- "list_id": "c004aae2-f191-4a1a-9d2a-e5894f8cecbf",
- "user_data": "good guys",
- "account_id": "c004aae2-f191-4a1a-9d2a-e5894f8cecbf",
- "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z"
}, - {
- "list_id": "a30f4c1d-976e-439b-82ce-16b99779f906",
- "account_id": "c004aae2-f191-4a1a-9d2a-e5894f8cecbf",
- "user_data": "",
- "create_time": "2021-06-18T21:50:40.953301+03:00",
- "last_update_time": "2021-06-18T21:50:40.953301+03:00"
}
]
}
Delete several lists.
with_faces | integer (int01) Default: 0 Enum: 0 1 Whether to delete list with all its faces. |
Content-Type | string Value: "application/json" Content type is |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
list_ids required | Array of strings <uuid> (list_id) non-empty Comma-separated list of list IDs for removal. |
{- "list_ids": [
- "string"
]
}
{- "error_code": 12022,
- "desc": "Bad/incomplete input data",
- "detail": "Failed to validate input json. Path: '', message: 'Additional properties are not allowed ('faces' was unexpected)'",
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Count lists according to the filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
user_data | string Example: user_data=user_data_text Find all objects with |
user_data__eq | string Example: user_data__eq=user_data_text Find all objects with same |
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for list create_time. |
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for list create_time. |
last_update_time__lt | string <date-time> (time) Example: last_update_time__lt=2018-08-11T09:11:41.674Z Upper excluded bound for list last_update_time. |
last_update_time__gte | string <date-time> (time) Example: last_update_time__gte=2018-08-11T09:11:41.674Z Lower included bound for list last_update_time. |
list_ids | Array of strings Comma-separated list of list IDs. |
list_id__lt | string <uuid> List ID upper excluding boundary. |
list_id__gte | string <uuid> List ID lower including boundary. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # get list according to the filters params = { "user_data": "good", "create_time__gte": "2020-10-10T09:11:41.674Z", "last_update_time__gte": "2020-10-10T09:11:41.674Z", } headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/lists/count" response = requests.get(url, params=params, headers=headers) print(response.status_code) print(response.json())
{- "lists_count": 3
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get list by ID.
list_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 List ID (list_id received in the "create list" request). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create list headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/lists" listId = requests.post(url, headers=headers).json()["list_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/lists/{listId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "list_id": "c004aae2-f191-4a1a-9d2a-e5894f8cecbf",
- "user_data": "good guys",
- "account_id": "c004aae2-f191-4a1a-9d2a-e5894f8cecbf",
- "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z"
}
Check if list with list_id
exists.
list_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 List ID (list_id received in the "create list" request). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create list headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/lists" listId = requests.post(url, headers=headers).json()["list_id"] # check list headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/lists/{listId}" response = requests.head(url, headers=headers) print(response.status_code) print(response.json())
Update the user_data field of the list.
list_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 List ID (list_id received in the "create list" request). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
user_data | string <= 128 characters User data associated with list. |
{- "user_data": "list of good persons"
}
{- "error_code": 12017,
- "desc": "Bad/incomplete input data",
- "detail": "Bad content type",
}
Delete list by ID.
list_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 List ID (list_id received in the "create list" request). |
with_faces | integer (int01) Default: 0 Enum: 0 1 Whether to delete list with all its faces. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create list headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/lists" listId = requests.post(url, headers=headers).json()["list_id"] # delete list headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } params = {"with_faces": 1} url = f"{baseUri}/lists/{listId}" response = requests.delete(url, params=params, headers=headers) print(response.status_code)
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Get options for the resource.
list_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 List ID (list_id received in the "create list" request). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Attach or detach faces to the list.
list_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 List ID (list_id received in the "create list" request). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
action required | string Enum: "attach" "detach" Expected action with list and faces. |
face_ids required | Array of strings <uuid> (face_id) [ 1 .. 1000 ] items Faces to attach or detach to/from list. It is preferable to use up to 100 face IDs per request to reduce the load on the system. |
{- "action": "attach",
- "face_ids": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
]
}
{- "error_code": 12017,
- "desc": "Bad/incomplete input data",
- "detail": "Bad content type",
}
Get options for the resource.
list_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 List ID (list_id received in the "create list" request). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Performs matching of given references with given candidates.
Note! Descriptors must be extracted for reference(s) and candidate(s). Objects without descriptors cannot be matched.
The sources for candidates are faces, attributes and events. See the "compare two faces using their IDs", "compare two events using their IDs", and "compare events using filters" examples.
You can specify the "list_id" filter of the "faces" candidate to perform matching by the specified list. See the "search by list and creation time" examples.
The sources for references are faces, events, attributes, external IDs of faces, or descriptors (raw, SDK format, or binary XPK format).
Matching results are returned for the candidates that correspond to the specified filters. If none of the candidates corresponds to the filters (for example, a non-existent ID is set in the "event_ids" field or the "face_ids" field), there will be no matching result and no error returned. The result field will be empty. See the "nonexistent references errors" examples.
If a non-existent reference is set (for example, a non-existent ID is set in the "event_id" field or the "face_id" field), the corresponding error is returned. See the "no ID for reference face found" response example.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Content-Type | string Enum: "application/json" "application/msgpack" Format of a request body data. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Accept | string Default: application/json Enum: "application/json" "application/msgpack" Determines response mime-type which client to expect. |
required | Array of candidate_face (object) or candidate_event (object) or candidate_attribute (object) [ 0 .. 30 ] items Candidates for matching. |
required | Array of any [ 1 .. 30 ] items References for matching. Each reference is matched with all given candidates. You can specify one or several references of one or several types. |
{- "candidates": [
- {
- "filters": {
- "origin": "faces",
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
- "external_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12550"
], - "user_data": "some_string",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2022-08-11T09:11:41.674Z",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "557d54ec-29ad-4f3c-93b4-c9092ef12519",
- "list_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}, - "limit": 3,
- "targets": [
- "face_id",
- "account_id",
- "event_id",
- "user_data",
- "create_time",
- "external_id",
- "lists",
- "similarity"
], - "threshold": 0.01
}
], - "references": [
- {
- "type": "face",
- "id": "35229c93-85f8-44f3-ab30-3248d7051af9"
}
]
}
[- {
- "reference": {
- "id": "a68f5995-766d-4a27-889a-35e373d0f0b2",
- "type": "face"
}, - "matches": [
- {
- "result": [
- {
- "face": {
- "face_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
- "event_id": null,
- "user_data": "some_string",
- "create_time": "2020-08-13T18:12:20.469171+03:00",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "lists": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
]
}, - "similarity": 0.9
}
], - "filters": {
- "origin": "faces",
- "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
- "external_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12550"
], - "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "user_data": "some_string",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2022-08-11T09:11:41.674Z",
- "face_id__gte": "000d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "557d54ec-29ad-4f3c-93b4-c9092ef12519",
- "list_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
}
]
}
]
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Matcher API allows to submit tasks to a service that searches for human bodies similar to a given reference(s) by matching them. A body attribute descriptor should be extracted for reference(s) and candidate(s).
The sources for references are events or binary descriptor. The sources for candidates is events.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Content-Type | string Enum: "application/json" "application/msgpack" Format of a request body data. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Accept | string Default: application/json Enum: "application/json" "application/msgpack" Determines response mime-type which client to expect. |
required | Array of any [ 1 .. 30 ] items References for matching. Each reference is matched with all given candidates. You can specify one or several references of one or several types. |
required | Array of objects (candidate_event) [ 1 .. 30 ] items Candidates for matching. |
{- "references": [
- {
- "type": "event",
- "id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
], - "candidates": [
- {
- "filters": {
- "origin": "events",
- "event_ids": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
], - "account_id": "string",
- "event_id__gte": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "event_id__lt": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "handler_ids": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
], - "external_ids": [
- "14159261415926"
], - "top_matching_candidates_label": "good guys",
- "top_similar_object_ids": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
], - "top_similar_external_ids": [
- "14159261415926"
], - "top_similar_object_similarity__gte": 0.5,
- "top_similar_object_similarity__lt": 0.5,
- "age__gte": 22,
- "age__lt": 30,
- "gender": 1,
- "emotions": [
- 4,
- 7
], - "liveness": 1,
- "deepfake": 1,
- "masks": [
- 1
], - "ethnic_groups": [
- 4,
- 3
], - "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "user_data": "info",
- "sources": [
- "cam1",
- "cam2",
- null
], - "stream_ids": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
], - "tags": [
- "tag1",
- "tag2"
], - "cities": [
- "moscow",
- "New-York",
- null
], - "areas": [
- "area1",
- "area2",
- null
], - "districts": [
- "mitino",
- "central park",
- null
], - "streets": [
- "arbat, schepkina",
- null
], - "house_numbers": [
- "1",
- "1/2str3",
- null
], - "geo_position": {
- "origin_longitude": 36.616,
- "origin_latitude": 55.752,
- "longitude_delta": 0.01,
- "latitude_delta": 0.01
}, - "track_ids": [
- "track_id_number_1",
- "track_id_number_2",
- null
], - "apparent_gender": [
- 1
], - "apparent_age__gte": 50,
- "apparent_age__lt": 50,
- "headwear_states": [
- 1
], - "headwear_apparent_colors": [
- "black"
], - "sleeve_lengths": [
- "short"
], - "upper_clothing_colors": [
- "black",
- "white"
], - "lower_garment_colors": [
- "black",
- "white"
], - "lower_garment_types": [
- "trousers"
], - "shoes_apparent_colors": [
- "black"
], - "backpack_states": [
- 1
], - "meta": {
- "user.age__gt": 18
}, - "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "end_time__gte": "2018-08-11T09:11:41.674Z",
- "end_time__lt": "2018-08-11T09:11:41.674Z"
}, - "order": "similarity",
- "limit": 3,
- "targets": [
- "event_id"
], - "threshold": 0.5
}
]
}
[- {
- "reference": {
- "id": "a68f5995-766d-4a27-889a-35e373d0f0b2",
- "type": "event"
}, - "matches": [
- {
- "result": [
- {
- "similarity": 0.5,
- "event": {
- "create_time": "2018-08-11T09:11:41.674Z",
- "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "handler_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
- "external_id": "14159261415926",
- "source": "Main_hall_camera",
- "stream_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
- "top_match": {
- "face_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "similarity": 0.6,
- "label": "good guys",
- "external_id": "external_id_1"
}, - "match_result": [
- {
- "candidates": [
- {
- "event": {
- "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "create_time": "2018-08-11T09:11:41.674Z",
- "external_id": null,
- "user_data": "user data",
- "handler_id": null,
- "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "source": "cam_1"
}, - "similarity": 0.5
}
], - "label": "good guy"
}
], - "face_detections": [
- {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}
}, - "detect_time": "2018-08-11T09:11:41.674Z",
- "detect_ts": 123.456,
- "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
], - "body_detections": [
- {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}
}, - "detect_time": "2018-08-11T09:11:41.674Z",
- "detect_ts": 123.456,
- "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
], - "face_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "attach_result": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
], - "gender": 1,
- "age": 29,
- "emotion": 1,
- "mask": 1,
- "ethnic_group": 4,
- "tags": [
- "tag1",
- "tag2"
], - "user_data": "info",
- "location": {
- "city": "Moscow",
- "area": "string",
- "district": "string",
- "street": "Lenina",
- "house_number": "3",
- "geo_position": {
- "longitude": -63.9,
- "latitude": 40.7
}
}, - "track_id": "useful_track_id_number_1"
}
}
], - "filters": {
- "origin": "events",
- "event_ids": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
], - "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
- "event_id__gte": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "event_id__lt": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "handler_ids": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
], - "external_ids": [
- "14159261415926"
], - "top_matching_candidates_label": "good guys",
- "top_similar_object_ids": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
], - "top_similar_external_ids": [
- "external_id_1"
], - "top_similar_object_similarity__gte": 0.5,
- "top_similar_object_similarity__lt": 0.5,
- "age__gte": 22,
- "age__lt": 30,
- "gender": 1,
- "emotions": [
- 4,
- 7
], - "masks": [
- 2,
- 3
], - "ethnic_groups": [
- 4,
- 3
], - "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "user_data": "user info",
- "sources": [
- "cam1",
- "cam2"
], - "tags": [
- "tag1",
- "tag2"
], - "cities": [
- "Moscow",
- "New-York"
], - "areas": [
- "area1",
- "area2"
], - "districts": [
- "mitino",
- "central park"
], - "streets": [
- "arbat",
- "schepkina"
], - "house_numbers": [
- "1",
- "1/2str3"
], - "geo_position": {
- "origin_longitude": 36.616,
- "origin_latitude": 55.752,
- "longitude_delta": 0.01,
- "latitude_delta": 0.01
}, - "track_ids": [
- "track_id_number_1",
- "track_id_number_2"
]
}
}
]
}, - {
- "reference": {
- "id": "a68f5995-766d-4a27-889a-35e373d0f0b2",
- "type": "event_external_id",
- "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}, - "matches": [
- {
- "result": [
- {
- "similarity": 1,
- "event": {
- "create_time": "2018-08-11T09:11:41.674Z",
- "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "handler_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
- "external_id": "14159261415926",
- "source": "Main_hall_camera",
- "stream_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
- "top_match": {
- "face_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "similarity": 0.6,
- "label": "good guys",
- "external_id": "external_id_1"
}, - "match_result": [
- {
- "candidates": [
- {
- "event": {
- "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "create_time": "2018-08-11T09:11:41.674Z",
- "external_id": null,
- "user_data": "user data",
- "handler_id": null,
- "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "source": "cam_1"
}, - "similarity": 0.5
}
], - "label": "good guy"
}
], - "face_detections": [
- {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}
}, - "detect_time": "2018-08-11T09:11:41.674Z",
- "detect_ts": 123.456,
- "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
], - "body_detections": [
- {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}
}, - "detect_time": "2018-08-11T09:11:41.674Z",
- "detect_ts": 123.456,
- "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
], - "face_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "attach_result": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
], - "gender": 1,
- "age": 29,
- "emotion": 1,
- "mask": 1,
- "ethnic_group": 4,
- "tags": [
- "tag1",
- "tag2"
], - "user_data": "info",
- "location": {
- "city": "Moscow",
- "area": "string",
- "district": "string",
- "street": "Lenina",
- "house_number": "3",
- "geo_position": {
- "longitude": -63.9,
- "latitude": 40.7
}
}, - "track_id": "useful_track_id_number_1"
}
}
], - "filters": {
- "origin": "events",
- "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397"
}
}
]
}
]
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Matcher raw API allows to do similarity calculations for input descriptors.
Content-Type | string Enum: "application/json" "application/msgpack" Format of a request body data. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Accept | string Default: application/json Enum: "application/json" "application/msgpack" Determines response mime-type which client to expect. |
required | Array of xpk_file_entity (object) or sdk_descriptor_entity (object) or raw_descriptor_entity (object) non-empty Reference list for matching. |
required | Array of xpk_file_entity (object) or sdk_descriptor_entity (object) or raw_descriptor_entity (object) non-empty Candidates for matching. |
{- "references": [
- {
- "id": "string",
- "type": "xpk_file",
- "data": "string"
}
], - "candidates": [
- {
- "id": "string",
- "type": "xpk_file",
- "data": "string"
}
]
}
{- "matches": [
- {
- "reference_id": "46aeab25-df7d-46bd-afe2-cf60706a0d96",
- "matches": [
- {
- "candidate_id": "f096439d-f306-49dc-bee9-266cb37e95eb",
- "similarity": 0.635
}
]
}, - {
- "reference_id": "raw-0",
- "matches": [
- {
- "candidate_id": "candidate",
- "similarity": 1
}, - {
- "candidate_id": "sdk",
- "similarity": 0.867
}, - {
- "candidate_id": "xpk",
- "similarity": 0.678
}
]
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a handler.
The handler determines the list of rules (policies) for processing of input images.
Handlers can be static, dynamic or lambda.
When the handler is static, you specify its policies and then you specify the created handler ID during the event creation.
When the handler is dynamic, you create it without predefined policies and then you specify them during event creation. You can create the dynamic handler by setting "handler_type" field to 1.
Some parameters from the
storage_policy
are enabled by default (for example,face_sample_policy > store_sample
). Don't forget to disable saving the necessary objects to avoid overflowing the storage.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
description | string <= 128 characters Description of the handler. Use it to distinguish the handler from other created handlers and filter handlers using "get handlers" and "get handler count" requests. |
object (Policies) The set of rules, which determine input images processing. The absence of policies indicates that the handler is dynamic. | |
handler_type | integer (handler_type) Default: 0 Enum: 0 1 2 Whether to get only non-dynamic (0), dynamic (1) or lambda (2) handlers. If type is non-dynamic:
If type is dynamic:
If type is lambda:
|
is_dynamic | boolean (is_dynamic) Deprecated Default: false Dynamic handler flag. If the value is set to "true", the handler is created without predefined policies. Use this flag to specify policies for each event created using resource "/handlers/{handler_id}/event". Use the request body schema "multipart/form-data" to specify policies. |
lambda_id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Lambda ID. |
{- "description": "Full handler example",
- "policies": {
- "detect_policy": {
- "estimate_people_count": {
- "estimate": 1,
- "people_coordinates": 1
}, - "detect_face": 1,
- "detect_body": 1,
- "multiface_policy": 1,
- "estimate_head_pose": 1,
- "estimate_emotions": 1,
- "estimate_mask": 1,
- "estimate_quality": 1,
- "estimate_gaze": 1,
- "estimate_glasses": 1,
- "estimate_eyes_attributes": 1,
- "estimate_mouth_attributes": 1,
- "detect_landmarks68": 1,
- "extract_exif": 1,
- "yaw_threshold": 180,
- "roll_threshold": 180,
- "pitch_threshold": 180,
- "mask_states": [
- 1
], - "estimate_liveness": {
- "estimate": 1,
- "liveness_threshold": 0.7
}, - "liveness_states": [
- 1
], - "estimate_deepfake": {
- "estimate": 1,
- "real_threshold": 0.7,
- "mode": 2
}, - "deepfake_states": [
- 1
], - "estimate_face_occlusion": {
- "estimate": 0,
- "eye_threshold": 0.15,
- "forehead_threshold": 0.2,
- "hair_occlusion_threshold": 0.15,
- "lower_face_threshold": 0.2,
- "mouth_threshold": 0.15,
- "nose_threshold": 0.2,
- "occlusion_threshold": 0.07
}, - "face_occlusion_states": [
- "eye"
], - "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.61,
- "max": 1
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.57,
- "max": 1
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": -8,
- "max": 8
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "glasses": {
- "estimate": 1,
- "threshold": [
- "no_glasses",
- "eyeglasses"
]
}, - "left_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "right_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "head_horizontal_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.45,
- "max": 0.55
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.5
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 0.75
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.6,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 90,
- "max": 1920
}
}, - "image_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "image_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1080
}
}, - "aspect_ratio": {
- "estimate": 1,
- "threshold": {
- "min": 0.74,
- "max": 0.8
}
}, - "face_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "face_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "image_size": {
- "estimate": 1,
- "threshold": {
- "min": 5120,
- "max": 2097152
}
}, - "eyebrows_state": {
- "estimate": 1,
- "threshold": [
- "neutral"
]
}, - "headwear_type": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "smile_properties": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "face_color_type": {
- "estimate": 1,
- "threshold": [
- "color"
]
}, - "natural_light": {
- "estimate": 1,
- "threshold": 1
}, - "radial_distortion": {
- "estimate": 1,
- "threshold": 0
}, - "red_eyes": {
- "estimate": 1,
- "threshold": 0
}, - "illumination_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_lightness": {
- "estimate": 1,
- "threshold": {
- "min": 0.2,
- "max": 1
}
}, - "face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "lower_face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "forehead_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "nose_occlusion": {
- "estimate": 1,
- "threshold": 0
}
}
}, - "body_attributes": {
- "estimate_basic_attributes": 1,
- "estimate_upper_body": 1,
- "estimate_lower_body": 1,
- "estimate_accessories": 1
}
}, - "extract_policy": {
- "extract_basic_attributes": 1,
- "extract_face_descriptor": 1,
- "fd_score_threshold": 0.6,
- "extract_body_descriptor": 1
}, - "match_policy": [
- {
- "label": "good guys",
- "candidates": {
- "origin": "faces",
- "face_ids": [
- "4db81a9a-515c-4cde-ac73-1810f5f737f2",
- "957a48ba-f457-4814-829a-0fa55bc246fc"
], - "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
- "external_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12550"
], - "user_data": "operator",
- "create_time__gte": "now-2y",
- "create_time__lt": "2022-08-11T09:11:41.674Z",
- "face_id__gte": "2046d39b-410d-481e-b9de-ede6a0c7367f",
- "face_id__lt": "957a48ba-f457-4814-829a-0fa55bc246fc",
- "list_id": "275d96c0-e655-4a69-a374-ad5e94b89bf9"
}, - "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 50,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
]
}, - "limit": 3,
- "targets": [
- "face_id"
], - "threshold": 0.5
}
], - "storage_policy": {
- "face_sample_policy": {
- "store_sample": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "ttl": 7
}, - "body_sample_policy": {
- "store_sample": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "ttl": 7
}, - "image_origin_policy": {
- "store_image": 1,
- "use_external_references": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "ttl": 7
}, - "attribute_policy": {
- "store_attribute": 1,
- "ttl": 300,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}, - "face_policy": {
- "store_face": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "set_sample_as_avatar": 0,
- "link_to_lists_policy": [
- {
- "list_id": "79bee337-484f-4124-b7e2-e4b76fb26308",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}
]
}, - "event_policy": {
- "store_event": 1,
- "wait_saving": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}, - "notification_policy": {
- "send_notification": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}, - "callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "username",
- "password": "password"
}, - "params": {
- "timeout": 5,
- "content_type": "application/json",
- "headers": { }
}, - "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "enable": 1
}
]
}, - "conditional_tags_policy": [
- {
- "tag": "new_tag",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 50,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.3
}
]
}
}
]
}, - "handler_type": 0
}
{- "handler_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "url": "/6/handlers/b5d6fd45-fcca-453d-ac05-3e594054b813",
}
Get handlers by filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
handler_type | integer Enum: 0 1 2 Whether to get only handler with specific type (0 - static, 1 - dynamic, 2 - lambda). If not specified handlers of any type will be received. If |
is_dynamic | integer Deprecated Enum: 0 1 Whether to get only dynamic (1) or non-dynamic (0) handlers. If not specified handlers of both type will received. |
description | string Records with descriptions similar to this parameter will be processed. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" params = { "description": "handler", "handler_type": 1, "page": 1, } headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/handlers" response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
[- {
- "handler_id": "de0846a8-09b2-4c6f-8175-99cfae98cf6b",
- "account_id": "3c3a83c2-c21e-4855-91b5-34e6b63fb12d",
- "description": "first handler",
- "policies": {
- "detect_policy": {
- "estimate_people_count": {
- "estimate": 1,
- "people_coordinates": 1
}, - "detect_face": 1,
- "detect_body": 1,
- "multiface_policy": 1,
- "estimate_head_pose": 1,
- "estimate_emotions": 1,
- "estimate_mask": 1,
- "estimate_quality": 1,
- "estimate_gaze": 1,
- "estimate_glasses": 1,
- "estimate_eyes_attributes": 1,
- "estimate_mouth_attributes": 1,
- "detect_landmarks68": 1,
- "extract_exif": 1,
- "yaw_threshold": 180,
- "roll_threshold": 180,
- "pitch_threshold": 180,
- "mask_states": [
- 1
], - "estimate_liveness": {
- "estimate": 1,
- "quality_threshold": 0.7,
- "liveness_threshold": 0.7
}, - "liveness_states": [
- 1
], - "estimate_deepfake": {
- "estimate": 1,
- "real_threshold": 0.7,
- "mode": 2
}, - "deepfake_states": [
- 1
], - "estimate_face_occlusion": {
- "estimate": 0,
- "eye_threshold": 0.15,
- "forehead_threshold": 0.2,
- "hair_occlusion_threshold": 0.15,
- "lower_face_threshold": 0.2,
- "mouth_threshold": 0.15,
- "nose_threshold": 0.2,
- "occlusion_threshold": 0.07
}, - "face_occlusion_states": null,
- "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.61,
- "max": 1
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.57,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": -8,
- "max": 8
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "glasses": {
- "estimate": 1,
- "threshold": [
- "no_glasses",
- "eyeglasses"
]
}, - "left_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "right_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "head_horizontal_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.45,
- "max": 0.55
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.5
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 0.75
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.6,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 90,
- "max": 1920
}
}, - "image_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "image_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1080
}
}, - "aspect_ratio": {
- "estimate": 1,
- "threshold": {
- "min": 0.74,
- "max": 0.8
}
}, - "face_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "face_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "image_size": {
- "estimate": 1,
- "threshold": {
- "min": 5120,
- "max": 2097152
}
}, - "eyebrows_state": {
- "estimate": 1,
- "threshold": [
- "neutral"
]
}, - "smile_properties": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "headwear_type": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "natural_light": {
- "estimate": 1,
- "threshold": 1
}, - "radial_distortion": {
- "estimate": 1,
- "threshold": 0
}, - "red_eyes": {
- "estimate": 1,
- "threshold": 0
}, - "face_color_type": {
- "estimate": 1,
- "threshold": [
- "color"
]
}, - "illumination_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_lightness": {
- "estimate": 1,
- "threshold": {
- "min": 0.2,
- "max": 1
}
}, - "background_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "shoulders_position": {
- "estimate": 1,
- "threshold": [
- "parallel"
]
}, - "face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "lower_face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "forehead_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "nose_occlusion": {
- "estimate": 1,
- "threshold": 0
}
}
}, - "body_attributes": {
- "estimate_basic_attributes": 0,
- "estimate_upper_body": 0,
- "estimate_lower_body": 0,
- "estimate_accessories": 0
}
}, - "extract_policy": {
- "extract_basic_attributes": 1,
- "extract_face_descriptor": 1,
- "fd_score_threshold": 0.6,
- "extract_body_descriptor": 1
}, - "match_policy": [
- {
- "label": "good guys",
- "candidates": {
- "origin": "faces",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2022-08-11T09:11:41.674Z"
}, - "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 50,
- "age__gte": 22
}, - "limit": 3,
- "targets": [
- "face_id"
], - "threshold": 0.5
}
], - "storage_policy": {
- "face_sample_policy": {
- "store_sample": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "ttl": 7
}, - "body_sample_policy": {
- "store_sample": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "ttl": 7
}, - "image_origin_policy": {
- "store_image": 1,
- "use_external_references": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "ttl": 7
}, - "attribute_policy": {
- "store_attribute": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "ttl": 300
}, - "face_policy": {
- "store_face": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "set_sample_as_avatar": 0,
- "link_to_lists_policy": [
- {
- "list_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}
]
}, - "event_policy": {
- "store_event": 1,
- "wait_saving": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}, - "notification_policy": {
- "send_notification": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}, - "callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "username",
- "password": "password"
}, - "params": {
- "timeout": 5,
- "content_type": "application/json",
- "headers": { }
}, - "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "enable": 1
}
]
}, - "conditional_tags_policy": [
- {
- "tag": "new_tag",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 50,
- "age__gte": 22,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.3
}
]
}
}
]
}, - "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z",
- "handler_type": 0
}, - {
- "handler_id": "ff0be071-1fd6-4641-a780-b8a87a871ef8",
- "account_id": "3c3a83c2-c21e-4855-91b5-34e6b63fb12d",
- "create_time": "2020-05-19T13:09:47.414773+03:00",
- "last_update_time": "2020-05-19T13:09:47.414773+03:00",
- "description": "76919ac6-95d2-4349-a7e9-5637117cdd29",
- "policies": {
- "detect_policy": {
- "estimate_people_count": {
- "estimate": 1,
- "people_coordinates": 1
}, - "multiface_policy": 1,
- "estimate_head_pose": 0,
- "estimate_emotions": 0,
- "estimate_mask": 0,
- "estimate_quality": 0,
- "estimate_gaze": 0,
- "estimate_glasses": 1,
- "estimate_eyes_attributes": 0,
- "estimate_mouth_attributes": 0,
- "detect_landmarks68": 0,
- "extract_exif": 0,
- "detect_face": 1,
- "detect_body": 0,
- "pitch_threshold": null,
- "roll_threshold": null,
- "yaw_threshold": null,
- "mask_states": null,
- "estimate_liveness": {
- "estimate": 1,
- "quality_threshold": 0.7,
- "liveness_threshold": 0.7
}, - "liveness_states": [
- 1
], - "estimate_deepfake": {
- "estimate": 1,
- "real_threshold": 0.7,
- "mode": 2
}, - "deepfake_states": [
- 1
], - "estimate_face_occlusion": {
- "estimate": 0,
- "eye_threshold": 0.15,
- "forehead_threshold": 0.2,
- "hair_occlusion_threshold": 0.15,
- "lower_face_threshold": 0.2,
- "mouth_threshold": 0.15,
- "nose_threshold": 0.2,
- "occlusion_threshold": 0.07
}, - "face_occlusion_states": null,
- "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.61,
- "max": 1
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.57,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": -8,
- "max": 8
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "glasses": {
- "estimate": 1,
- "threshold": [
- "no_glasses",
- "eyeglasses"
]
}, - "left_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "right_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "head_horizontal_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.45,
- "max": 0.55
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.5
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 0.75
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.6,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 90,
- "max": 1920
}
}, - "image_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "image_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1080
}
}, - "aspect_ratio": {
- "estimate": 1,
- "threshold": {
- "min": 0.74,
- "max": 0.8
}
}, - "face_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "face_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "image_size": {
- "estimate": 1,
- "threshold": {
- "min": 5120,
- "max": 2097152
}
}, - "eyebrows_state": {
- "estimate": 1,
- "threshold": [
- "neutral"
]
}, - "smile_properties": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "headwear_type": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "natural_light": {
- "estimate": 1,
- "threshold": 1
}, - "radial_distortion": {
- "estimate": 1,
- "threshold": 0
}, - "red_eyes": {
- "estimate": 1,
- "threshold": 0
}, - "face_color_type": {
- "estimate": 1,
- "threshold": [
- "color"
]
}, - "illumination_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_lightness": {
- "estimate": 1,
- "threshold": {
- "min": 0.2,
- "max": 1
}
}, - "background_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "shoulders_position": {
- "estimate": 1,
- "threshold": [
- "parallel"
]
}, - "face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "lower_face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "forehead_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "nose_occlusion": {
- "estimate": 1,
- "threshold": 0
}
}
}, - "body_attributes": {
- "estimate_basic_attributes": 1,
- "estimate_upper_body": 1,
- "estimate_lower_body": 1,
- "estimate_accessories": 1
}
}, - "extract_policy": {
- "extract_basic_attributes": 0,
- "fd_score_threshold": 0,
- "extract_face_descriptor": 1,
- "extract_body_descriptor": 0
}, - "match_policy": [ ],
- "conditional_tags_policy": [ ],
- "storage_policy": {
- "face_sample_policy": {
- "filters": { },
- "store_sample": 1,
- "ttl": 7
}, - "body_sample_policy": {
- "filters": { },
- "store_sample": 1,
- "ttl": 7
}, - "image_origin_policy": {
- "filters": { },
- "store_image": 0,
- "use_external_references": 0,
- "ttl": 7
}, - "attribute_policy": {
- "filters": { },
- "store_attribute": 0,
- "ttl": 300
}, - "face_policy": {
- "filters": { },
- "store_face": 0,
- "set_sample_as_avatar": 1,
- "link_to_lists_policy": [ ]
}, - "event_policy": {
- "filters": { },
- "store_event": 1,
- "wait_saving": 1
}, - "notification_policy": {
- "filters": { },
- "send_notification": 1
}, - "callbacks": [ ]
}
}, - "handler_type": 0
}
]
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Count handlers.
description | string Find all the handlers with description similar to this parameter. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
handler_type | integer Enum: 0 1 2 Whether to get only handler with specific type (0 - static, 1 - dynamic, 2 - lambda). If not specified handlers of any type will be received. If |
is_dynamic | integer Deprecated Enum: 0 1 Whether to get only dynamic (1) or non-dynamic (0) handlers. If not specified handlers of both type will received. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } params = { "description": "handler", "handler_type": 0, } url = f"{baseUri}/handlers/count" response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "handlers_count": 5
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Validate handler policies before using them to create or update a handler.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
required | object (Policies) The set of rules, which determine input images processing. The absence of policies indicates that the handler is dynamic. |
{- "policies": {
- "detect_policy": {
- "estimate_people_count": {
- "estimate": 0,
- "people_coordinates": 1
}, - "detect_face": 1,
- "detect_body": 0,
- "multiface_policy": 0,
- "estimate_head_pose": 0,
- "estimate_emotions": 0,
- "estimate_mask": 0,
- "estimate_quality": 0,
- "estimate_gaze": 0,
- "estimate_glasses": 0,
- "estimate_eyes_attributes": 0,
- "estimate_mouth_attributes": 0,
- "detect_landmarks68": 0,
- "extract_exif": 0,
- "yaw_threshold": 180,
- "roll_threshold": 180,
- "pitch_threshold": 180,
- "mask_states": [ ],
- "estimate_liveness": {
- "estimate": 0,
- "liveness_threshold": 0.5,
- "quality_threshold": 0.5
}, - "liveness_states": [ ],
- "estimate_deepfake": {
- "estimate": 0,
- "real_threshold": 0.5,
- "mode": 1
}, - "deepfake_states": [ ],
- "estimate_face_occlusion": {
- "estimate": 0,
- "occlusion_threshold": 0.07,
- "hair_occlusion_threshold": 0.15,
- "forehead_threshold": 0.2,
- "eye_threshold": 0.15,
- "nose_threshold": 0.2,
- "mouth_threshold": 0.15,
- "lower_face_threshold": 0.2
}, - "face_occlusion_states": [ ],
- "face_quality": {
- "estimate": 0,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 0,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "glasses": {
- "estimate": 0,
- "threshold": [
- "no_glasses",
- "eyeglasses"
]
}, - "left_eye": {
- "estimate": 0,
- "threshold": [
- "open"
]
}, - "right_eye": {
- "estimate": 0,
- "threshold": [
- "open"
]
}, - "head_horizontal_center": {
- "estimate": 0,
- "threshold": {
- "min": 0.45,
- "max": 0.55
}
}, - "head_vertical_center": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.5
}
}, - "head_width": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 0.75
}
}, - "head_height": {
- "estimate": 0,
- "threshold": {
- "min": 0.6,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 0,
- "threshold": {
- "min": 91.1,
- "max": 92.2
}
}, - "image_width": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "image_height": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1080
}
}, - "aspect_ratio": {
- "estimate": 0,
- "threshold": {
- "min": 0.74,
- "max": 0.8
}
}, - "face_width": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "face_height": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 0
}
}, - "indent_left": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_right": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_upper": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_lower": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "image_size": {
- "estimate": 0,
- "threshold": {
- "min": 5120,
- "max": 2097152
}
}, - "eyebrows_state": {
- "estimate": 0,
- "threshold": [
- "neutral"
]
}, - "headwear_type": {
- "estimate": 0,
- "threshold": [
- "none"
]
}, - "smile_properties": {
- "estimate": 0,
- "threshold": [
- "none"
]
}, - "face_color_type": {
- "estimate": 0,
- "threshold": [
- "color"
]
}, - "natural_light": {
- "estimate": 0,
- "threshold": 0
}, - "red_eyes": {
- "estimate": 0,
- "threshold": 0
}, - "radial_distortion": {
- "estimate": 0,
- "threshold": 0
}, - "illumination_uniformity": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_uniformity": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_lightness": {
- "estimate": 0,
- "threshold": {
- "min": 0.2,
- "max": 1
}
}, - "shoulders_position": {
- "estimate": 0,
- "threshold": [
- "parallel"
]
}, - "face_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "lower_face_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "forehead_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "nose_occlusion": {
- "estimate": 0,
- "threshold": 0
}
}
}, - "body_attributes": {
- "estimate_basic_attributes": 0,
- "estimate_upper_body": 0,
- "estimate_lower_body": 0,
- "estimate_accessories": 0
}
}, - "extract_policy": {
- "extract_basic_attributes": 0,
- "extract_face_descriptor": 1,
- "fd_score_threshold": 0.7,
- "extract_body_descriptor": 0
}, - "match_policy": [
- {
- "label": "",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
]
}, - "descriptor": {
- "descriptor_type": "face"
}, - "limit": 3,
- "targets": [
- "face_id"
], - "threshold": 0.5,
- "candidates": {
- "origin": "faces",
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "account_id": "string",
- "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "string",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z"
}
}
], - "storage_policy": {
- "face_sample_policy": {
- "store_sample": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "ttl": 7
}, - "body_sample_policy": {
- "store_sample": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "ttl": 7
}, - "image_origin_policy": {
- "store_image": 0,
- "use_external_references": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "ttl": 7
}, - "attribute_policy": {
- "store_attribute": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "ttl": 300
}, - "face_policy": {
- "store_face": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "set_sample_as_avatar": 1,
- "link_to_lists_policy": [
- {
- "list_id": "string",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}
]
}, - "event_policy": {
- "store_event": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "wait_saving": 1
}, - "notification_policy": {
- "send_notification": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}, - "callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}, - "enable": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}
]
}, - "conditional_tags_policy": [
- {
- "tag": "good",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}
]
}
}
{- "error_code": 12017,
- "desc": "Bad/incomplete input data",
- "detail": "Bad content type",
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get handler by ID.
handler_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Handler ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
import requests baseUri = "http://127.0.0.1:5000/6" # create handler headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/handlers" payload = {"handler_type": 1} dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"] # get handler headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=" } url = f"{baseUri}/handlers/{dynamicHandlerId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "handler_id": "de0846a8-09b2-4c6f-8175-99cfae98cf6b",
- "account_id": "3c3a83c2-c21e-4855-91b5-34e6b63fb12d",
- "description": "first handler",
- "policies": {
- "detect_policy": {
- "estimate_people_count": {
- "estimate": 0
}, - "detect_face": 1,
- "detect_body": 1,
- "multiface_policy": 1,
- "estimate_head_pose": 1,
- "estimate_emotions": 1,
- "estimate_mask": 1,
- "estimate_quality": 1,
- "estimate_gaze": 1,
- "estimate_glasses": 1,
- "estimate_eyes_attributes": 1,
- "estimate_mouth_attributes": 1,
- "detect_landmarks68": 1,
- "extract_exif": 1,
- "yaw_threshold": 180,
- "roll_threshold": 180,
- "pitch_threshold": 180,
- "mask_states": [
- 1
], - "estimate_liveness": {
- "estimate": 1,
- "quality_threshold": 0.7,
- "liveness_threshold": 0.7
}, - "liveness_states": [
- 1
], - "estimate_deepfake": {
- "estimate": 1,
- "real_threshold": 0.7,
- "mode": 2
}, - "deepfake_states": [
- 1
], - "estimate_face_occlusion": {
- "estimate": 0,
- "eye_threshold": 0.15,
- "forehead_threshold": 0.2,
- "hair_occlusion_threshold": 0.15,
- "lower_face_threshold": 0.2,
- "mouth_threshold": 0.15,
- "nose_threshold": 0.2,
- "occlusion_threshold": 0.07
}, - "face_occlusion_states": [
- "face"
], - "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.61,
- "max": 1
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.57,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": -8,
- "max": 8
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "glasses": {
- "estimate": 1,
- "threshold": [
- "no_glasses",
- "eyeglasses"
]
}, - "left_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "right_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "head_horizontal_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.45,
- "max": 0.55
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.5
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 0.75
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.6,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 90,
- "max": 1920
}
}, - "image_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "image_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1080
}
}, - "aspect_ratio": {
- "estimate": 1,
- "threshold": {
- "min": 0.74,
- "max": 0.8
}
}, - "face_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "face_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "image_size": {
- "estimate": 1,
- "threshold": {
- "min": 5120,
- "max": 2097152
}
}, - "eyebrows_state": {
- "estimate": 1,
- "threshold": [
- "neutral"
]
}, - "smile_properties": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "headwear_type": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "natural_light": {
- "estimate": 1,
- "threshold": 1
}, - "radial_distortion": {
- "estimate": 1,
- "threshold": 0
}, - "red_eyes": {
- "estimate": 1,
- "threshold": 0
}, - "face_color_type": {
- "estimate": 1,
- "threshold": [
- "color"
]
}, - "illumination_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_lightness": {
- "estimate": 1,
- "threshold": {
- "min": 0.2,
- "max": 1
}
}, - "background_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "shoulders_position": {
- "estimate": 1,
- "threshold": [
- "parallel"
]
}, - "face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "lower_face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "forehead_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "nose_occlusion": {
- "estimate": 1,
- "threshold": 0
}
}
}, - "body_attributes": {
- "estimate_basic_attributes": 0,
- "estimate_upper_body": 0,
- "estimate_lower_body": 0,
- "estimate_accessories": 0
}
}, - "extract_policy": {
- "extract_basic_attributes": 1,
- "extract_face_descriptor": 1,
- "fd_score_threshold": 0.6,
- "extract_body_descriptor": 1
}, - "match_policy": [
- {
- "label": "good guys",
- "candidates": {
- "origin": "faces",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2022-08-11T09:11:41.674Z"
}, - "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 50,
- "age__gte": 22
}, - "limit": 3,
- "targets": [
- "face_id"
], - "threshold": 0.5
}
], - "storage_policy": {
- "face_sample_policy": {
- "store_sample": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "ttl": 7
}, - "body_sample_policy": {
- "store_sample": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "ttl": 7
}, - "image_origin_policy": {
- "store_image": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "ttl": 7
}, - "attribute_policy": {
- "store_attribute": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "ttl": 300
}, - "face_policy": {
- "store_face": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "set_sample_as_avatar": 0,
- "link_to_lists_policy": [
- {
- "list_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}
]
}, - "event_policy": {
- "store_event": 1,
- "wait_saving": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}, - "notification_policy": {
- "send_notification": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}, - "callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "username",
- "password": "password"
}, - "params": {
- "timeout": 5,
- "content_type": "application/json",
- "headers": { }
}, - "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}, - "enable": 1
}
]
}, - "conditional_tags_policy": [
- {
- "tag": "new_tag",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 50,
- "age__gte": 22,
- "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.3
}
]
}
}
]
}, - "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z",
- "handler_type": 0
}
Update handler. You cannot update a part of the handler, so you should specify all the fields for your handler.
handler_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Handler ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
description | string <= 128 characters Description of the handler. Use it to distinguish the handler from other created handlers and filter handlers using "get handlers" and "get handler count" requests. |
object (Policies) The set of rules, which determine input images processing. The absence of policies indicates that the handler is dynamic. | |
handler_type | integer (handler_type) Default: 0 Enum: 0 1 2 Whether to get only non-dynamic (0), dynamic (1) or lambda (2) handlers. If type is non-dynamic:
If type is dynamic:
If type is lambda:
|
is_dynamic | boolean (is_dynamic) Deprecated Default: false Dynamic handler flag. If the value is set to "true", the handler is created without predefined policies. Use this flag to specify policies for each event created using resource "/handlers/{handler_id}/event". Use the request body schema "multipart/form-data" to specify policies. |
lambda_id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Lambda ID. |
{- "description": "Handler example",
- "policies": {
- "detect_policy": {
- "estimate_people_count": {
- "estimate": 0,
- "people_coordinates": 1
}, - "detect_face": 1,
- "detect_body": 0,
- "multiface_policy": 0,
- "estimate_head_pose": 0,
- "estimate_emotions": 0,
- "estimate_mask": 0,
- "estimate_quality": 0,
- "estimate_gaze": 0,
- "estimate_glasses": 0,
- "estimate_eyes_attributes": 0,
- "estimate_mouth_attributes": 0,
- "detect_landmarks68": 0,
- "extract_exif": 0,
- "yaw_threshold": 180,
- "roll_threshold": 180,
- "pitch_threshold": 180,
- "mask_states": [ ],
- "estimate_liveness": {
- "estimate": 0,
- "liveness_threshold": 0.5,
- "quality_threshold": 0.5
}, - "liveness_states": [ ],
- "estimate_deepfake": {
- "estimate": 0,
- "real_threshold": 0.5,
- "mode": 1
}, - "deepfake_states": [ ],
- "estimate_face_occlusion": {
- "estimate": 0,
- "occlusion_threshold": 0.07,
- "hair_occlusion_threshold": 0.15,
- "forehead_threshold": 0.2,
- "eye_threshold": 0.15,
- "nose_threshold": 0.2,
- "mouth_threshold": 0.15,
- "lower_face_threshold": 0.2
}, - "face_occlusion_states": [ ],
- "face_quality": {
- "estimate": 0,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 0,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "glasses": {
- "estimate": 0,
- "threshold": [
- "no_glasses",
- "eyeglasses"
]
}, - "left_eye": {
- "estimate": 0,
- "threshold": [
- "open"
]
}, - "right_eye": {
- "estimate": 0,
- "threshold": [
- "open"
]
}, - "head_horizontal_center": {
- "estimate": 0,
- "threshold": {
- "min": 0.45,
- "max": 0.55
}
}, - "head_vertical_center": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.5
}
}, - "head_width": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 0.75
}
}, - "head_height": {
- "estimate": 0,
- "threshold": {
- "min": 0.6,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 0,
- "threshold": {
- "min": 91.1,
- "max": 92.2
}
}, - "image_width": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "image_height": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1080
}
}, - "aspect_ratio": {
- "estimate": 0,
- "threshold": {
- "min": 0.74,
- "max": 0.8
}
}, - "face_width": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "face_height": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 0
}
}, - "indent_left": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_right": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_upper": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_lower": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "image_size": {
- "estimate": 0,
- "threshold": {
- "min": 5120,
- "max": 2097152
}
}, - "eyebrows_state": {
- "estimate": 0,
- "threshold": [
- "neutral"
]
}, - "headwear_type": {
- "estimate": 0,
- "threshold": [
- "none"
]
}, - "smile_properties": {
- "estimate": 0,
- "threshold": [
- "none"
]
}, - "face_color_type": {
- "estimate": 0,
- "threshold": [
- "color"
]
}, - "natural_light": {
- "estimate": 0,
- "threshold": 0
}, - "red_eyes": {
- "estimate": 0,
- "threshold": 0
}, - "radial_distortion": {
- "estimate": 0,
- "threshold": 0
}, - "illumination_uniformity": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_uniformity": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_lightness": {
- "estimate": 0,
- "threshold": {
- "min": 0.2,
- "max": 1
}
}, - "shoulders_position": {
- "estimate": 0,
- "threshold": [
- "parallel"
]
}, - "face_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "lower_face_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "forehead_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "nose_occlusion": {
- "estimate": 0,
- "threshold": 0
}
}
}, - "body_attributes": {
- "estimate_basic_attributes": 0,
- "estimate_upper_body": 0,
- "estimate_lower_body": 0,
- "estimate_accessories": 0
}
}, - "extract_policy": {
- "extract_basic_attributes": 0,
- "extract_face_descriptor": 1,
- "fd_score_threshold": 0.7,
- "extract_body_descriptor": 0
}, - "match_policy": [
- {
- "label": "",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
]
}, - "descriptor": {
- "descriptor_type": "face"
}, - "limit": 3,
- "targets": [
- "face_id"
], - "threshold": 0.5,
- "candidates": {
- "origin": "faces",
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "account_id": "string",
- "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "string",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z"
}
}
], - "storage_policy": {
- "face_sample_policy": {
- "store_sample": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "ttl": 7
}, - "body_sample_policy": {
- "store_sample": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "ttl": 7
}, - "image_origin_policy": {
- "store_image": 0,
- "use_external_references": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "ttl": 7
}, - "attribute_policy": {
- "store_attribute": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "ttl": 300
}, - "face_policy": {
- "store_face": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "set_sample_as_avatar": 1,
- "link_to_lists_policy": [
- {
- "list_id": "string",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}
]
}, - "event_policy": {
- "store_event": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "wait_saving": 1
}, - "notification_policy": {
- "send_notification": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}, - "callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}, - "enable": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}
]
}, - "conditional_tags_policy": [
- {
- "tag": "good",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "deepfake": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}
]
}, - "handler_type": 0,
- "is_dynamic": false,
- "lambda_id": "string"
}
{- "error_code": 12017,
- "desc": "Bad/incomplete input data",
- "detail": "Bad content type",
}
Check if handler with handler_id
exists.
handler_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Handler ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
import requests baseUri = "http://127.0.0.1:5000/6" headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/handlers" payload = {"handler_type": 1} dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/handlers/{dynamicHandlerId}" response = requests.head(url, headers=headers) print(response.status_code)
Remove handler by ID.
handler_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Handler ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
import requests baseUri = "http://127.0.0.1:5000/6" headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/handlers" payload = {"handler_type": 1} dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/handlers/{dynamicHandlerId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Get options for the resource.
handler_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Handler ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Process images and/or raw descriptors using the specified handler and generate events.
Specify the multipart/form-data
schema if you need to specify the dynamic handler policies.
If the Events service support is disabled on the server, events will not be saved to the database.
Notes for incoming data:
Objects to be processed must belong to the user account making the request.
handler_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Handler ID. |
city | string (location_str) <= 36 characters Example: city=New York City where an event occurred. |
area | string (location_str) <= 36 characters Example: area=Manhattan Area where an event occurred. |
district | string (location_str) <= 36 characters Example: district=Midtown District where an event occurred. |
street | string (location_str) <= 36 characters Example: street=West 48th street Street where an event occurred. |
house_number | string (location_str) <= 36 characters Example: house_number=220 House number where an event occurred. |
longitude | number (longitude) [ -180 .. 180 ] Example: longitude=36.616 Longitude in degrees, a part of composite geo position. Geo position is considered as properly specified if both longitude and latitude are set. |
latitude | number (latitude) [ -90 .. 90 ] Example: latitude=55.752 Latitude in degrees, a part of composite geo position. Geo position is considered as properly specified if both longitude and latitude are set. |
external_id | string (event_external_id) <= 36 characters Default: "" Example: external_id=14159261415926 External ID for created events and faces (if When Unicode symbols (for example, the "+" symbol) are used in "external_id", the string should be encoded. Otherwise, the Unicode symbols will be lost. The "luna3" client library provides the encoding example |
user_data | string (face_user_data) <= 128 characters Default: "" Example: user_data=face of person User data for created events and faces (if |
image_type | integer Default: 0 Enum: 0 1 2 Type of input image. 0 - raw image, 1 - face warped image, 2 - body warped image. |
aggregate_attributes | integer (aggregate_attributes) Whether to aggregate the following parameters:
Aggregation will be performed only if the appropriate parameters for estimating the listed above parameters are enabled in the handler. If set, all estimated parameters from each image will be aggregated and stored in the event as single objects for all images. In the response body, the aggregated face basic attributes of all images will be displayed in the Otherwise, all estimated parameters from each image will be stored in the event as separate objects. In the response body, the face basic attributes will be displayed in the |
source | string (source) <= 128 characters Example: source=3rd Avenue Additional information provided by user along with event. |
stream_id | string <uuid> (stream_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: stream_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Stream ID. |
tags | Array of strings (tag) >= 0 items [ items <= 36 characters ] Example: tags=tag_1,tag_2 Comma-separated list of tags. Each event from result will contain all of given tags. Each tag can be at most 36 characters. |
track_id | string (track_id) ^[a-zA-Z0-9_\-]{1,36}$ Example: track_id=useful_track_id_number_1 Event track ID. |
use_exif_info | integer Default: 1 Enum: 0 1 Example: use_exif_info=1 Whether to try to auto orient image based on EXIF data. The processed image should have EXIF data, otherwise auto orientation will not be performed. Has no effect with tiff images (they're always auto oriented). Ignored with warped images (see |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Luna-Event-Time | string <date-time> (time) Examples:
User defined event time. All events will be saved with this time as "create_time". Format of time is rfc3339. Any other format is ignored. |
Luna-Event-End-Time | string <date-time> (time) Examples:
User defined event end time. All events will be saved with this time as "end_time". Format of time is rfc3339. All other format is ignored. |
Content-Type | string Enum: "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "multipart/form-data" "application/json" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64" "application/x-sdk-descriptor" "application/x-vl-xpk" "application/x-sdk-descriptor-base64" "applicaition/x-vl-xpk-base64" |
{- "images": [
- {
- "error": {
- "error_code": 0,
- "desc": "Success",
- "detail": "Success",
}, - "status": 1,
- "filename": "person.jpg",
- "exif": {
- "flash": "16",
- "software": "Adobe Photoshop CC 2017 (Windows)",
- "artist": "VisionLabs",
- "make": "NIKON CORPORATION",
- "model": "NIKON D810"
}, - "image_estimations": {
- "people": {
- "count": 1,
- "coordinates": [
- [
- 125,
- 125
]
]
}
}
}
], - "events": [
- {
- "face_attributes": {
- "attribute_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "basic_attributes": {
- "age": 29,
- "gender": 1,
- "ethnicities": {
- "estimations": {
- "african_american": 1.92238889737406e-12,
- "asian": 0.954671621322632,
- "caucasian": 0.045328326523304,
- "indian": 7.65100649502415e-10
}, - "predominant_ethnicity": "asian"
}
}, - "score": 0.7525901794,
- "url": "/6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
- "samples": [
- "a3e8716f-70dc-42ad-8428-7a552e800a37"
], - "filter": {
- "is_filtered": true,
- "filter_reasons": [
- {
- "filter_name": "score_threshold",
- "object_value": 0,
- "threshold_value": 0
}
]
}
}, - "body_attributes": {
- "score": 0.3546702648,
- "samples": [
- "a3e8716f-70dc-42ad-8428-7a552e800a37"
]
}, - "source": "3rd Avenue",
- "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "tags": [
- "tag1",
- "tag2"
], - "external_id": "b668c4a5-2191-some-important-words",
- "user_data": "string",
- "face": {
- "face_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "event_id": "f9687459-986b-406d-9c1f-0d6289be5256",
- "user_data": "fox1991",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "avatar": "/6/samples/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c",
- "lists": [
- "429b0e78-4616-426a-b57f-02baa72d638d",
- "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
], - "url": "/6/faces/24d405ce-bc56-4bf7-98e1-bdc962b4cf34"
}, - "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "url": "/6/events/24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
- "matches": [
- {
- "label": "good guys",
- "candidates": [
- {
- "face": {
- "face_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "user_data": "fox1991",
- "create_time": "2018-08-11T09:11:41.674Z",
- "lists": [
- "429b0e78-4616-426a-b57f-02baa72d638d",
- "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
], - "avatar": "/6/samples/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c",
- "event_id": "f9687459-986b-406d-9c1f-0d6289be5256"
}, - "similarity": 0.5
}
]
}, - {
- "label": "bad guys",
- "candidates": [
- {
- "event": {
- "event_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "user_data": "fox1991",
- "create_time": "2018-08-11T09:11:41.674Z",
- "handler_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7",
- "source": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7",
- "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7"
}, - "similarity": 0.3
}
]
}
], - "location": {
- "city": "string",
- "area": "string",
- "district": "string",
- "street": "string",
- "house_number": "string",
- "geo_position": {
- "longitude": 36.616,
- "latitude": 55.752
}
}, - "detections": [
- {
- "filename": "penelope.jpeg",
- "samples": {
- "body": {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}, - "attributes": {
- "basic_attributes": {
- "apparent_age": 0,
- "apparent_gender": 0
}, - "upper_body": {
- "headwear": {
- "state": 0,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "short"
}, - "upper_clothing": {
- "colors": [
- "white",
- "black"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "trousers",
- "colors": [
- "white",
- "black"
]
}, - "shoes": {
- "apparent_color": "black"
}
}, - "accessories": {
- "backpack": {
- "state": 0
}
}
}
}, - "url": "/6/samples/bodies/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c"
}, - "face": {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "attributes": {
- "mouth_attributes": {
- "occluded": 0,
- "opened": 0,
- "score": 1,
- "smile": 0
}, - "emotions": {
- "estimations": {
- "anger": 0.00894705578684807,
- "disgust": 0.00000965219624049496,
- "fear": 0.00121302821207792,
- "happiness": 0.00129503419157118,
- "neutral": 0.986027479171753,
- "sadness": 0.00187553185969591,
- "surprise": 0.000632198702078313
}, - "predominant_emotion": "neutral"
}, - "mask": {
- "estimations": {
- "medical_mask": 0.7108324766,
- "missing": 0.0700698048,
- "occluded": 0.2190976739
}, - "predominant_mask": "medical_mask",
- "face_occlusion": {
- "predominant_occlusion": "correct",
- "estimations": {
- "full": 0.019,
- "clear": 0.02,
- "correct": 0.6108324766,
- "partially": 0.31,
- "mouth": 0.0209,
- "chin": 0.019097
}
}
}, - "head_pose": {
- "pitch": 18.6827487945557,
- "roll": -10.3542232513428,
- "yaw": 15.4102487564087
}, - "gaze": {
- "pitch": 9.26744079589844,
- "yaw": -19.4657287597656
}, - "eyes_attributes": {
- "right_eye": {
- "state": "open",
- "iris_landmarks": [
- [
- 152,
- 152
], - [
- 153,
- 153
], - [
- 153,
- 153
], - [
- 154,
- 154
], - [
- 154,
- 154
], - [
- 155,
- 155
], - [
- 157,
- 157
], - [
- 158,
- 158
], - [
- 159,
- 159
], - [
- 161,
- 161
], - [
- 162,
- 162
], - [
- 163,
- 163
], - [
- 164,
- 164
], - [
- 165,
- 165
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 167,
- 167
], - [
- 167,
- 167
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 165,
- 165
], - [
- 164,
- 164
], - [
- 162,
- 162
], - [
- 161,
- 161
], - [
- 160,
- 160
], - [
- 158,
- 158
], - [
- 157,
- 157
], - [
- 156,
- 156
], - [
- 155,
- 155
], - [
- 154,
- 154
], - [
- 154,
- 154
], - [
- 153,
- 153
]
]
}, - "left_eye": {
- "state": "open",
- "iris_landmarks": [
- [
- 92,
- 92
], - [
- 92,
- 92
], - [
- 92,
- 92
], - [
- 93,
- 93
], - [
- 94,
- 94
], - [
- 95,
- 95
], - [
- 96,
- 96
], - [
- 97,
- 97
], - [
- 98,
- 98
], - [
- 100,
- 100
], - [
- 101,
- 101
], - [
- 102,
- 102
], - [
- 103,
- 103
], - [
- 104,
- 104
], - [
- 104,
- 104
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 104,
- 104
], - [
- 104,
- 104
], - [
- 103,
- 103
], - [
- 103,
- 103
], - [
- 102,
- 102
], - [
- 100,
- 100
], - [
- 99,
- 99
], - [
- 98,
- 98
], - [
- 97,
- 97
], - [
- 95,
- 95
], - [
- 94,
- 94
], - [
- 93,
- 93
], - [
- 93,
- 93
], - [
- 92,
- 92
]
]
}
}
}, - "quality": {
- "light": 0.87,
- "dark": 0.13,
- "illumination": 0.1,
- "specularity": 0.1,
- "blurriness": 0.2
}, - "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}, - "landmarks68": [
- [
- 8,
- 8
], - [
- 14,
- 14
], - [
- 28,
- 28
], - [
- 48,
- 48
], - [
- 72,
- 72
], - [
- 102,
- 102
], - [
- 134,
- 134
], - [
- 168,
- 168
], - [
- 213,
- 213
], - [
- 262,
- 262
], - [
- 306,
- 306
], - [
- 345,
- 345
], - [
- 376,
- 376
], - [
- 392,
- 392
], - [
- 397,
- 397
], - [
- 399,
- 399
], - [
- 394,
- 394
], - [
- 2,
- 2
], - [
- 22,
- 22
], - [
- 50,
- 50
], - [
- 79,
- 79
], - [
- 106,
- 106
], - [
- 165,
- 165
], - [
- 199,
- 199
], - [
- 236,
- 236
], - [
- 278,
- 278
], - [
- 317,
- 317
], - [
- 137,
- 137
], - [
- 136,
- 136
], - [
- 136,
- 136
], - [
- 136,
- 136
], - [
- 119,
- 119
], - [
- 135,
- 135
], - [
- 154,
- 154
], - [
- 174,
- 174
], - [
- 193,
- 193
], - [
- 40,
- 40
], - [
- 57,
- 57
], - [
- 83,
- 83
], - [
- 108,
- 108
], - [
- 84,
- 84
], - [
- 58,
- 58
], - [
- 203,
- 203
], - [
- 222,
- 222
], - [
- 249,
- 249
], - [
- 277,
- 277
], - [
- 258,
- 258
], - [
- 229,
- 229
], - [
- 119,
- 119
], - [
- 130,
- 130
], - [
- 149,
- 149
], - [
- 167,
- 167
], - [
- 185,
- 185
], - [
- 222,
- 222
], - [
- 259,
- 259
], - [
- 232,
- 232
], - [
- 200,
- 200
], - [
- 177,
- 177
], - [
- 155,
- 155
], - [
- 134,
- 134
], - [
- 127,
- 127
], - [
- 152,
- 152
], - [
- 170,
- 170
], - [
- 190,
- 190
], - [
- 250,
- 250
], - [
- 193,
- 193
], - [
- 172,
- 172
], - [
- 152,
- 152
]
], - "landmarks5": [
- [
- 72,
- 72
], - [
- 240,
- 240
], - [
- 154,
- 154
], - [
- 119,
- 119
], - [
- 259,
- 259
]
], - "face_quality": {
- "status": 0,
- "checks": [
- {
- "name": "image_format",
- "object_value": "JPEG",
- "threshold_value": [
- "JPEG",
- "JPEG2000",
- "PNG"
], - "result": 1
}, - {
- "name": "illumination_quality",
- "object_value": 0.6005162000656128,
- "threshold_value": {
- "min": 0.3,
- "max": 1
}, - "result": 1
}, - {
- "name": "specularity_quality",
- "object_value": 0.7662366628646851,
- "threshold_value": {
- "min": 0.3,
- "max": 1
}, - "result": 1
}, - {
- "name": "blurriness_quality",
- "object_value": 0.9429352283477783,
- "threshold_value": {
- "min": 0.61,
- "max": 1
}, - "result": 1
}, - {
- "name": "dark_quality",
- "object_value": 0.9020983576774597,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "light_quality",
- "object_value": 0.7881984114646912,
- "threshold_value": {
- "min": 0.57,
- "max": 1
}, - "result": 1
}, - {
- "name": "head_yaw",
- "object_value": 2.818983316421509,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_pitch",
- "object_value": 3.816443920135498,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_roll",
- "object_value": 5.434040069580078,
- "threshold_value": {
- "min": -8,
- "max": 8
}, - "result": 1
}, - {
- "name": "gaze_yaw",
- "object_value": -3.773012399673462,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "gaze_pitch",
- "object_value": 0.7140519022941589,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "mouth_smiling",
- "object_value": 0.000290759839117527,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_occluded",
- "object_value": 0.00009619363845558837,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_open",
- "object_value": 0.6226108074188232,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "glasses",
- "object_value": "no_glasses",
- "threshold_value": [
- "no_glasses",
- "eyeglasses"
], - "result": 1
}, - {
- "name": "left_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "right_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "head_horizontal_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.45,
- "max": 0.55
}, - "result": 1
}, - {
- "name": "head_vertical_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.3,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "head_width",
- "object_value": 0.61,
- "threshold_value": {
- "min": 0.5,
- "max": 0.75
}, - "result": 1
}, - {
- "name": "head_height",
- "object_value": 0.71,
- "threshold_value": {
- "min": 0.6,
- "max": 0.9
}, - "result": 1
}, - {
- "name": "eye_distance",
- "object_value": 110,
- "threshold_value": {
- "min": 90,
- "max": null
}, - "result": 1
}, - {
- "name": "image_width",
- "object_value": 1000,
- "threshold_value": {
- "min": 200,
- "max": 1100
}, - "result": 1
}, - {
- "name": "image_height",
- "object_value": 2000,
- "threshold_value": {
- "min": 200,
- "max": 1100
}, - "result": 1
}, - {
- "name": "aspect_ratio",
- "object_value": 0.5,
- "threshold_value": {
- "min": 0.1,
- "max": 1
}, - "result": 1
}, - {
- "name": "face_width",
- "object_value": 500,
- "threshold_value": {
- "min": 400,
- "max": 600
}, - "result": 1
}, - {
- "name": "face_height",
- "object_value": 500,
- "threshold_value": {
- "min": 400,
- "max": 600
}, - "result": 1
}, - {
- "name": "indent_left",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_right",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_upper",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_lower",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "image_size",
- "object_value": 100500,
- "threshold_value": {
- "min": 10,
- "max": 100600
}, - "result": 1
}, - {
- "name": "eyebrows_state",
- "object_value": "neutral",
- "threshold_value": [
- "neutral"
], - "result": 1
}, - {
- "name": "smile_properties",
- "object_value": "smile_lips",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "headwear_type",
- "object_value": "hat",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "natural_light",
- "object_value": 1,
- "threshold_value": 1,
- "result": 1
}, - {
- "name": "radial_distortion",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "red_eyes",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "face_color_type",
- "object_value": "color",
- "threshold_value": [
- "color"
], - "result": 1
}, - {
- "name": "illumination_uniformity",
- "object_value": 0.7305162000656128,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "dynamic_range",
- "object_value": 0.6605162000656128,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "background_lightness",
- "object_value": 0.5780888795852661,
- "threshold_value": {
- "min": 0.2,
- "max": 1
}, - "result": 1
}, - {
- "name": "background_uniformity",
- "object_value": 0.8874394297599792,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "shoulders_position",
- "object_value": "parallel",
- "threshold_value": [
- "parallel"
], - "result": 1
}
]
}
}, - "url": "/6/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c"
}
}, - "detect_time": "2018-08-11T09:11:41.674Z",
- "detect_ts": 123.456,
- "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
], - "track_id": "useful_track_id_number_1",
- "meta": {
- "foo": "bar"
}, - "aggregate_estimations": {
- "face": {
- "attributes": {
- "liveness": {
- "prediction": "real",
- "estimations": {
- "quality": 1,
- "score": 0.8
}
}, - "deepfake": {
- "prediction": "real",
- "score": 0.8
}
}
}, - "body": {
- "attributes": {
- "upper_body": {
- "headwear": {
- "state": 0,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "short"
}, - "upper_clothing": {
- "colors": [
- "white",
- "black"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "trousers",
- "colors": [
- "white",
- "black"
]
}, - "shoes": {
- "apparent_color": "black"
}
}, - "accessories": {
- "backpack": {
- "state": 0
}
}
}
}
}
}
], - "filtered_detections": {
- "face_detections": [ ]
}
}
Get options for the resource.
handler_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Handler ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
WARNING Experimental resource. Backwards compatibility is not guaranteed.
Process images using the specified handler and generate stream events.
If the Events service support is disabled on the server, events will not be saved to the database.
Notes for incoming data:
Objects to be processed must belong to the user account making the request.
handler_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Handler ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/msgpack" Format of a request body data. |
aggregate_attributes required | integer (aggregate_attributes) Whether to aggregate attributes. If the value is set to "0", a descriptor and basic attributes are extracted for each sample. If the value is set to "1", you can create an aggregated descriptor, receive aggregated basic attributes, or both. The behavior depends on the
|
required | Array of any (event_sources_non_aggregated) non-empty |
use_exif_info | integer (use_exif_info) Default: 1 Enum: 0 1 Whether to try to auto orient image based on exif data Has no effect with tiff images (they're always auto oriented). Ignored with warped images (see |
{ "aggregate_attributes": 0, "sources": [ { "detect_time": "2023-11-29T10:48:14.741Z", "filename": "filename_267.jpg", "source": [ { "body": { "origin_bounding_box": { "height": 468, "width": 96, "x": 1824, "y": 294 }, "warp": "image_bytes" }, "source_data": { "event_end_time": "2023-11-29T10:48:14.741Z", "event_time": "2023-11-29T10:48:14.741Z", "location": { "area": "Central", "city": "Moscow", "district": "Basmanny", "geo_position": { "latitude": 55.752, "longitude": 36.616 }, "house_number": "23 bldg.3", "street": "Podsosensky lane" }, "source": "Source 0", "stream_id": "319d711e-6148-4c55-9eed-094b7e535fe7", "track_id": "8d57654a-3905-4326-8db6-dcf8000000a3", "user_data": "" }, "trusted_detections": 1 } ], "source_type": "detections" } ], "use_exif_info": 1 }
{- "images": [
- {
- "error": {
- "error_code": 0,
- "desc": "Success",
- "detail": "Success",
}, - "status": 1,
- "filename": "person.jpg",
- "exif": {
- "flash": "16",
- "software": "Adobe Photoshop CC 2017 (Windows)",
- "artist": "VisionLabs",
- "make": "NIKON CORPORATION",
- "model": "NIKON D810"
}, - "image_estimations": {
- "people": {
- "count": 1,
- "coordinates": [
- [
- 125,
- 125
]
]
}
}
}
], - "events": [
- {
- "face_attributes": {
- "attribute_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "basic_attributes": {
- "age": 29,
- "gender": 1,
- "ethnicities": {
- "estimations": {
- "african_american": 1.92238889737406e-12,
- "asian": 0.954671621322632,
- "caucasian": 0.045328326523304,
- "indian": 7.65100649502415e-10
}, - "predominant_ethnicity": "asian"
}
}, - "score": 0.7525901794,
- "url": "/6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
- "samples": [
- "a3e8716f-70dc-42ad-8428-7a552e800a37"
], - "filter": {
- "is_filtered": true,
- "filter_reasons": [
- {
- "filter_name": "score_threshold",
- "object_value": 0,
- "threshold_value": 0
}
]
}
}, - "body_attributes": {
- "score": 0.3546702648,
- "samples": [
- "a3e8716f-70dc-42ad-8428-7a552e800a37"
]
}, - "source": "3rd Avenue",
- "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "tags": [
- "tag1",
- "tag2"
], - "external_id": "b668c4a5-2191-some-important-words",
- "user_data": "string",
- "face": {
- "face_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "event_id": "f9687459-986b-406d-9c1f-0d6289be5256",
- "user_data": "fox1991",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "avatar": "/6/samples/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c",
- "lists": [
- "429b0e78-4616-426a-b57f-02baa72d638d",
- "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
], - "url": "/6/faces/24d405ce-bc56-4bf7-98e1-bdc962b4cf34"
}, - "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "url": "/6/events/24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
- "matches": [
- {
- "label": "good guys",
- "candidates": [
- {
- "face": {
- "face_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "user_data": "fox1991",
- "create_time": "2018-08-11T09:11:41.674Z",
- "lists": [
- "429b0e78-4616-426a-b57f-02baa72d638d",
- "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
], - "avatar": "/6/samples/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c",
- "event_id": "f9687459-986b-406d-9c1f-0d6289be5256"
}, - "similarity": 0.5
}
]
}, - {
- "label": "bad guys",
- "candidates": [
- {
- "event": {
- "event_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "user_data": "fox1991",
- "create_time": "2018-08-11T09:11:41.674Z",
- "handler_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7",
- "source": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7",
- "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7"
}, - "similarity": 0.3
}
]
}
], - "location": {
- "city": "string",
- "area": "string",
- "district": "string",
- "street": "string",
- "house_number": "string",
- "geo_position": {
- "longitude": 36.616,
- "latitude": 55.752
}
}, - "detections": [
- {
- "filename": "penelope.jpeg",
- "samples": {
- "body": {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}, - "attributes": {
- "basic_attributes": {
- "apparent_age": 0,
- "apparent_gender": 0
}, - "upper_body": {
- "headwear": {
- "state": 0,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "short"
}, - "upper_clothing": {
- "colors": [
- "white",
- "black"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "trousers",
- "colors": [
- "white",
- "black"
]
}, - "shoes": {
- "apparent_color": "black"
}
}, - "accessories": {
- "backpack": {
- "state": 0
}
}
}
}, - "url": "/6/samples/bodies/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c"
}, - "face": {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "attributes": {
- "mouth_attributes": {
- "occluded": 0,
- "opened": 0,
- "score": 1,
- "smile": 0
}, - "emotions": {
- "estimations": {
- "anger": 0.00894705578684807,
- "disgust": 0.00000965219624049496,
- "fear": 0.00121302821207792,
- "happiness": 0.00129503419157118,
- "neutral": 0.986027479171753,
- "sadness": 0.00187553185969591,
- "surprise": 0.000632198702078313
}, - "predominant_emotion": "neutral"
}, - "mask": {
- "estimations": {
- "medical_mask": 0.7108324766,
- "missing": 0.0700698048,
- "occluded": 0.2190976739
}, - "predominant_mask": "medical_mask",
- "face_occlusion": {
- "predominant_occlusion": "correct",
- "estimations": {
- "full": 0.019,
- "clear": 0.02,
- "correct": 0.6108324766,
- "partially": 0.31,
- "mouth": 0.0209,
- "chin": 0.019097
}
}
}, - "head_pose": {
- "pitch": 18.6827487945557,
- "roll": -10.3542232513428,
- "yaw": 15.4102487564087
}, - "gaze": {
- "pitch": 9.26744079589844,
- "yaw": -19.4657287597656
}, - "eyes_attributes": {
- "right_eye": {
- "state": "open",
- "iris_landmarks": [
- [
- 152,
- 152
], - [
- 153,
- 153
], - [
- 153,
- 153
], - [
- 154,
- 154
], - [
- 154,
- 154
], - [
- 155,
- 155
], - [
- 157,
- 157
], - [
- 158,
- 158
], - [
- 159,
- 159
], - [
- 161,
- 161
], - [
- 162,
- 162
], - [
- 163,
- 163
], - [
- 164,
- 164
], - [
- 165,
- 165
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 167,
- 167
], - [
- 167,
- 167
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 165,
- 165
], - [
- 164,
- 164
], - [
- 162,
- 162
], - [
- 161,
- 161
], - [
- 160,
- 160
], - [
- 158,
- 158
], - [
- 157,
- 157
], - [
- 156,
- 156
], - [
- 155,
- 155
], - [
- 154,
- 154
], - [
- 154,
- 154
], - [
- 153,
- 153
]
]
}, - "left_eye": {
- "state": "open",
- "iris_landmarks": [
- [
- 92,
- 92
], - [
- 92,
- 92
], - [
- 92,
- 92
], - [
- 93,
- 93
], - [
- 94,
- 94
], - [
- 95,
- 95
], - [
- 96,
- 96
], - [
- 97,
- 97
], - [
- 98,
- 98
], - [
- 100,
- 100
], - [
- 101,
- 101
], - [
- 102,
- 102
], - [
- 103,
- 103
], - [
- 104,
- 104
], - [
- 104,
- 104
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 104,
- 104
], - [
- 104,
- 104
], - [
- 103,
- 103
], - [
- 103,
- 103
], - [
- 102,
- 102
], - [
- 100,
- 100
], - [
- 99,
- 99
], - [
- 98,
- 98
], - [
- 97,
- 97
], - [
- 95,
- 95
], - [
- 94,
- 94
], - [
- 93,
- 93
], - [
- 93,
- 93
], - [
- 92,
- 92
]
]
}
}
}, - "quality": {
- "light": 0.87,
- "dark": 0.13,
- "illumination": 0.1,
- "specularity": 0.1,
- "blurriness": 0.2
}, - "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}, - "landmarks68": [
- [
- 8,
- 8
], - [
- 14,
- 14
], - [
- 28,
- 28
], - [
- 48,
- 48
], - [
- 72,
- 72
], - [
- 102,
- 102
], - [
- 134,
- 134
], - [
- 168,
- 168
], - [
- 213,
- 213
], - [
- 262,
- 262
], - [
- 306,
- 306
], - [
- 345,
- 345
], - [
- 376,
- 376
], - [
- 392,
- 392
], - [
- 397,
- 397
], - [
- 399,
- 399
], - [
- 394,
- 394
], - [
- 2,
- 2
], - [
- 22,
- 22
], - [
- 50,
- 50
], - [
- 79,
- 79
], - [
- 106,
- 106
], - [
- 165,
- 165
], - [
- 199,
- 199
], - [
- 236,
- 236
], - [
- 278,
- 278
], - [
- 317,
- 317
], - [
- 137,
- 137
], - [
- 136,
- 136
], - [
- 136,
- 136
], - [
- 136,
- 136
], - [
- 119,
- 119
], - [
- 135,
- 135
], - [
- 154,
- 154
], - [
- 174,
- 174
], - [
- 193,
- 193
], - [
- 40,
- 40
], - [
- 57,
- 57
], - [
- 83,
- 83
], - [
- 108,
- 108
], - [
- 84,
- 84
], - [
- 58,
- 58
], - [
- 203,
- 203
], - [
- 222,
- 222
], - [
- 249,
- 249
], - [
- 277,
- 277
], - [
- 258,
- 258
], - [
- 229,
- 229
], - [
- 119,
- 119
], - [
- 130,
- 130
], - [
- 149,
- 149
], - [
- 167,
- 167
], - [
- 185,
- 185
], - [
- 222,
- 222
], - [
- 259,
- 259
], - [
- 232,
- 232
], - [
- 200,
- 200
], - [
- 177,
- 177
], - [
- 155,
- 155
], - [
- 134,
- 134
], - [
- 127,
- 127
], - [
- 152,
- 152
], - [
- 170,
- 170
], - [
- 190,
- 190
], - [
- 250,
- 250
], - [
- 193,
- 193
], - [
- 172,
- 172
], - [
- 152,
- 152
]
], - "landmarks5": [
- [
- 72,
- 72
], - [
- 240,
- 240
], - [
- 154,
- 154
], - [
- 119,
- 119
], - [
- 259,
- 259
]
], - "face_quality": {
- "status": 0,
- "checks": [
- {
- "name": "image_format",
- "object_value": "JPEG",
- "threshold_value": [
- "JPEG",
- "JPEG2000",
- "PNG"
], - "result": 1
}, - {
- "name": "illumination_quality",
- "object_value": 0.6005162000656128,
- "threshold_value": {
- "min": 0.3,
- "max": 1
}, - "result": 1
}, - {
- "name": "specularity_quality",
- "object_value": 0.7662366628646851,
- "threshold_value": {
- "min": 0.3,
- "max": 1
}, - "result": 1
}, - {
- "name": "blurriness_quality",
- "object_value": 0.9429352283477783,
- "threshold_value": {
- "min": 0.61,
- "max": 1
}, - "result": 1
}, - {
- "name": "dark_quality",
- "object_value": 0.9020983576774597,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "light_quality",
- "object_value": 0.7881984114646912,
- "threshold_value": {
- "min": 0.57,
- "max": 1
}, - "result": 1
}, - {
- "name": "head_yaw",
- "object_value": 2.818983316421509,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_pitch",
- "object_value": 3.816443920135498,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_roll",
- "object_value": 5.434040069580078,
- "threshold_value": {
- "min": -8,
- "max": 8
}, - "result": 1
}, - {
- "name": "gaze_yaw",
- "object_value": -3.773012399673462,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "gaze_pitch",
- "object_value": 0.7140519022941589,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "mouth_smiling",
- "object_value": 0.000290759839117527,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_occluded",
- "object_value": 0.00009619363845558837,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_open",
- "object_value": 0.6226108074188232,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "glasses",
- "object_value": "no_glasses",
- "threshold_value": [
- "no_glasses",
- "eyeglasses"
], - "result": 1
}, - {
- "name": "left_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "right_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "head_horizontal_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.45,
- "max": 0.55
}, - "result": 1
}, - {
- "name": "head_vertical_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.3,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "head_width",
- "object_value": 0.61,
- "threshold_value": {
- "min": 0.5,
- "max": 0.75
}, - "result": 1
}, - {
- "name": "head_height",
- "object_value": 0.71,
- "threshold_value": {
- "min": 0.6,
- "max": 0.9
}, - "result": 1
}, - {
- "name": "eye_distance",
- "object_value": 110,
- "threshold_value": {
- "min": 90,
- "max": null
}, - "result": 1
}, - {
- "name": "image_width",
- "object_value": 1000,
- "threshold_value": {
- "min": 200,
- "max": 1100
}, - "result": 1
}, - {
- "name": "image_height",
- "object_value": 2000,
- "threshold_value": {
- "min": 200,
- "max": 1100
}, - "result": 1
}, - {
- "name": "aspect_ratio",
- "object_value": 0.5,
- "threshold_value": {
- "min": 0.1,
- "max": 1
}, - "result": 1
}, - {
- "name": "face_width",
- "object_value": 500,
- "threshold_value": {
- "min": 400,
- "max": 600
}, - "result": 1
}, - {
- "name": "face_height",
- "object_value": 500,
- "threshold_value": {
- "min": 400,
- "max": 600
}, - "result": 1
}, - {
- "name": "indent_left",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_right",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_upper",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_lower",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "image_size",
- "object_value": 100500,
- "threshold_value": {
- "min": 10,
- "max": 100600
}, - "result": 1
}, - {
- "name": "eyebrows_state",
- "object_value": "neutral",
- "threshold_value": [
- "neutral"
], - "result": 1
}, - {
- "name": "smile_properties",
- "object_value": "smile_lips",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "headwear_type",
- "object_value": "hat",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "natural_light",
- "object_value": 1,
- "threshold_value": 1,
- "result": 1
}, - {
- "name": "radial_distortion",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "red_eyes",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "face_color_type",
- "object_value": "color",
- "threshold_value": [
- "color"
], - "result": 1
}, - {
- "name": "illumination_uniformity",
- "object_value": 0.7305162000656128,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "dynamic_range",
- "object_value": 0.6605162000656128,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "background_lightness",
- "object_value": 0.5780888795852661,
- "threshold_value": {
- "min": 0.2,
- "max": 1
}, - "result": 1
}, - {
- "name": "background_uniformity",
- "object_value": 0.8874394297599792,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "shoulders_position",
- "object_value": "parallel",
- "threshold_value": [
- "parallel"
], - "result": 1
}
]
}
}, - "url": "/6/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c"
}
}, - "detect_time": "2018-08-11T09:11:41.674Z",
- "detect_ts": 123.456,
- "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
], - "track_id": "useful_track_id_number_1",
- "meta": {
- "foo": "bar"
}, - "aggregate_estimations": {
- "face": {
- "attributes": {
- "liveness": {
- "prediction": "real",
- "estimations": {
- "quality": 1,
- "score": 0.8
}
}, - "deepfake": {
- "prediction": "real",
- "score": 0.8
}
}
}, - "body": {
- "attributes": {
- "upper_body": {
- "headwear": {
- "state": 0,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "short"
}, - "upper_clothing": {
- "colors": [
- "white",
- "black"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "trousers",
- "colors": [
- "white",
- "black"
]
}, - "shoes": {
- "apparent_color": "black"
}
}, - "accessories": {
- "backpack": {
- "state": 0
}
}
}
}
}
}
], - "filtered_detections": {
- "face_detections": [ ]
}
}
Get options for the resource.
handler_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Handler ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Save event which was generated by the user. The event structure is similar to an event from handler response. Input events
will send to the Sender also and to plugins. Therefore, these events are the same events except that events were
generated an external handler
. Handler ID must belong to a dynamic handler.
handler_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Dynamic handler ID. |
wait_saving | integer Default: 1 Enum: 0 1 Whether to wait for raw event saving. If "0" is specified, the 202 status code will be expected in response to a successful request. This status code is returned after event is validated and added to the buffer. The system does not wait until the event is saved to the database. The event will be stored in the database after the response is sent. If "1" is specified, the 201 status code will be expected in response to a successful request. This status code is returned only after event is stored in the database. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
Array of objects <= 100 items List of body & face related detections. | |
source | string (source) <= 128 characters Additional information that user provides with event. |
stream_id | string <uuid> (stream_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Stream ID. |
object (input_event_location) Information about place where an event occurred. | |
external_id | string (event_external_id) <= 36 characters Default: "" User-defined external ID for the event. |
user_data | string (event_user_data) <= 128 characters Default: "" User data associated with event. |
track_id | string (track_id) ^[a-zA-Z0-9_\-]{1,36}$ Event track ID. |
object (input_event_face) Face associated with event. | |
Array of objects or null <= 30 items Sorted list with match result for the event. | |
object or null (input_event_face_attribute) User extracted event face attributes. | |
object or null (input_event_body_attribute) User extracted event body attributes. | |
object (input_event_aggregate_estimations) Aggregated attributes estimated from samples. | |
tags | Array of strings [ 0 .. 1000 ] items [ items <= 36 characters ] List of tags. |
create_time | string <date-time> Time of the event creation. |
end_time | string <date-time> The end time of the event. |
object (event_meta_common) User defined metadata (JSON object). Size shouldn't exceed 2MB. To be able to further search for meta using GET requests, JSON must have a valid format without spaces in field names. Use only latin letters, numbers, and single underscores in field names. |
{- "detections": [
- {
- "filename": "",
- "samples": {
- "body": {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}, - "attributes": {
- "basic_attributes": {
- "apparent_age": 33,
- "apparent_gender": 1
}, - "upper_body": {
- "headwear": {
- "state": 1,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "long"
}, - "upper_clothing": {
- "colors": [
- "black",
- "white"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "undefined",
- "colors": [
- "black",
- "white"
]
}, - "shoes": {
- "apparent_color": "undefined"
}
}, - "accessories": {
- "backpack": {
- "state": 1
}
}
}
}, - "url": "/6/samples/bodies/45838c8b-04a1-4230-bda0-b5f77609b695"
}, - "face": {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "quality": {
- "light": 0.87,
- "dark": 0.13,
- "illumination": 0.1,
- "specularity": 0.1,
- "blurriness": 0.2
}, - "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}, - "landmarks5": [ ],
- "landmarks68": [ ],
- "attributes": {
- "mouth_attributes": {
- "occluded": 0,
- "score": 0.999999165534973,
- "smile": 0
}, - "mask": {
- "estimations": {
- "medical_mask": 0.7108324766,
- "missing": 0.0700698048,
- "occluded": 0.2190976739
}, - "predominant_mask": "medical_mask",
- "face_occlusion": {
- "predominant_occlusion": "correct",
- "estimations": {
- "full": 0.019,
- "clear": 0.02,
- "correct": 0.6108324766,
- "partially": 0.31,
- "mouth": 0.0209,
- "chin": 0.019097
}
}
}, - "emotions": {
- "estimations": {
- "anger": 0.00894705578684807,
- "disgust": 0.00000965219624049496,
- "fear": 0.00121302821207792,
- "happiness": 0.00129503419157118,
- "neutral": 0.986027479171753,
- "sadness": 0.00187553185969591,
- "surprise": 0.000632198702078313
}, - "predominant_emotion": "neutral"
}, - "head_pose": {
- "pitch": 18.6827487945557,
- "roll": -10.3542232513428,
- "yaw": 15.4102487564087
}, - "gaze": {
- "pitch": 9.26744079589844,
- "yaw": -19.4657287597656
}, - "glasses": {
- "glasses": "no_glasses"
}, - "liveness": {
- "prediction": "real",
- "estimations": {
- "score": 0.99,
- "quality": 1
}
}, - "deepfake": {
- "prediction": "real",
- "score": 0.99
}, - "face_occlusion": {
- "prediction": 0,
- "estimations": {
- "overall_score": 0.01,
- "hair_score": 0.02,
- "lower_face_score": 0.012,
- "nose_score": 0.002,
- "mouth_score": 0.003,
- "forehead_score": 0.012,
- "left_eye_score": 0.032,
- "right_eye_score": 0.021
}, - "face_occlusion": {
- "lower_face_occluded": 0,
- "mouth_occluded": 0,
- "nose_occluded": 0,
- "left_eye_occluded": 0,
- "right_eye_occluded": 0,
- "forehead_occluded": 0
}
}
}, - "face_quality": {
- "status": 0,
- "checks": [
- {
- "name": "image_format",
- "object_value": "JPEG",
- "threshold_value": [
- null
], - "result": 0
}
]
}
}, - "url": "/6/samples/faces/45838c8b-04a1-4230-bda0-b5f77609b695"
}
}, - "detect_time": "2018-08-11T09:11:41.674Z",
- "detect_ts": 123.456,
- "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e\n"
}
], - "source": "3rd Avenue",
- "stream_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "location": {
- "city": "string",
- "area": "string",
- "district": "string",
- "street": "string",
- "house_number": "string",
- "geo_position": {
- "longitude": 0,
- "latitude": 0
}
}, - "external_id": "14159261415926",
- "user_data": "some event",
- "track_id": "useful_track_id_number_1",
- "face": {
- "face_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "event_id": "f9687459-986b-406d-9c1f-0d6289be5256",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "user_data": "fox1991",
- "lists": [
- "429b0e78-4616-426a-b57f-02baa72d638d",
- "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
], - "url": "/6/faces/426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
}, - "matches": [
- {
- "label": "good guys",
- "candidates": [
- {
- "face": {
- "face_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "user_data": "fox1991",
- "create_time": "2018-08-11T09:11:41.674Z"
}, - "similarity": 0.5
}
]
}, - {
- "label": "bad guys",
- "candidates": [
- {
- "event": {
- "event_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "user_data": "fox1991",
- "create_time": "2018-08-11T09:11:41.674Z",
- "handler_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7",
- "source": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7",
- "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7"
}, - "similarity": 0.3
}
]
}
], - "face_attributes": {
- "attribute_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "basic_attributes": {
- "age": 29,
- "gender": 1,
- "ethnicities": {
- "predominant_ethnicity": "african_american",
- "estimations": {
- "asian": 1,
- "indian": 1,
- "caucasian": 1,
- "african_american": 1
}
}
}, - "score": 1,
- "samples": [ ],
- "descriptor": "string",
- "url": "../dictionary"
}, - "body_attributes": {
- "score": 1,
- "samples": [ ],
- "descriptor": "string"
}, - "aggregate_estimations": {
- "face": {
- "attributes": null
}, - "body": {
- "attributes": {
- "basic_attributes": {
- "apparent_age": 33,
- "apparent_gender": 1
}, - "upper_body": {
- "headwear": {
- "state": 1,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "long"
}, - "upper_clothing": {
- "colors": [
- "black",
- "white"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "undefined",
- "colors": [
- "black",
- "white"
]
}, - "shoes": {
- "apparent_color": "undefined"
}
}, - "accessories": {
- "backpack": {
- "state": 1
}
}
}
}
}, - "tags": [
- "tag1",
- "tag2"
], - "create_time": "2018-08-11T09:11:41.674Z",
- "end_time": "2018-08-11T09:11:41.674Z",
- "meta": {
- "key": "value"
}
}
{- "event_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "url": "/6/events/b5d6fd45-fcca-453d-ac05-3e594054b813",
}
Get options for the resource.
handler_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Dynamic handler ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get event statistics by target(s) with applied filters.
Event fields and/or functions (count, min, etc.) can be set as targets for aggregation of events.
Grouping by frequency or grouping by time intervals is available.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
Array of objects (targets) >= 0 items Default: [{"column":"event_id","aggregator":"count"}] You can specify one or several event fields and functions for them for data aggregation. The table includes event fields and available functions for them:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of objects (filters) >= 0 items Specifies filters for events. Operators available for each filter:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of objects (periods) >= 0 items Specifies the period of event creation. All the events created during this period will be included in the statistics. You can set the start and end of the period or only one of the bounds.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
group_by | string (group_by) Enables you to group events by creation time according to one of two ways:
|
{- "targets": [
- {
- "column": "event_id",
- "aggregator": "count"
}, - {
- "column": "age",
- "aggregator": "group_by"
}, - {
- "column": "gender",
- "aggregator": "group_by"
}
], - "filters": [
- {
- "column": "source",
- "operator": "eq",
- "value": "Main_hall_camera"
}
], - "period": [
- {
- "operator": "gt",
- "value": "2020-02-04T00:00:00Z"
}, - {
- "operator": "lt",
- "value": "2020-02-06T00:00:00Z"
}
], - "group_by": "dayOfWeek"
}
{- "fields": [
- "Group by time: dayOfWeek",
- "gender, aggregator 'group_by'",
- "age, aggregator 'group_by'",
- "event_id, aggregator 'count'"
], - "stats": [
- [
- "Tuesday",
- 0,
- 22,
- 45
], - [
- "Tuesday",
- 0,
- 27,
- 23
], - [
- "Tuesday",
- 1,
- 27,
- 45
], - [
- "Wednesday",
- 0,
- 25,
- 34
], - [
- "Wednesday",
- 1,
- 33,
- 345
]
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get events that satisfy filters.
Default filters for events:
create_time__lt
- current date and timecreate_time__gte
- current date and time minus monthDefault filters are not used if any of the following parameters are defined:
- list of event IDs (`event_ids`)
- lower event ID boundary (`event_id__gte`)
- upper event ID boundary (`event_id__lt`)
- lower create time boundary (`create_time__gte`)
- upper create time boundary (`create_time__lt`)
The target
parameter determines field that will be shown for each event. If target is not set, the response will contain all the fields.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
target | Array of strings (events_targets) Items Enum: "event_id" "account_id" "create_time" "end_time" "external_id" "handler_id" "stream_id" "source" "top_match" "match_result" "face_detections" "body_detections" "face_id" "attach_result" "gender" "age" "emotion" "ethnic_group" "tags" "user_data" "location" "mask" "liveness" "deepfake" "track_id" "body_basic_attributes" "upper_body" "lower_body" "accessories" "meta" Example: target=create_time,event_id,face_detections Comma-separated list of event fields. If set, each event from result will contain only specified fields, otherwise, events with all fields will be returned. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
end_time__gte | string <date-time> (time) Example: end_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object end_time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
end_time__lt | string <date-time> (time) Example: end_time__lt=2018-08-11T09:11:41.674Z Upper bound for object end_time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
insert_time__gte | string <date-time> (time) Example: insert_time__gte=2018-08-11T09:11:41.674Z The lower insert time including boundary. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
insert_time__lt | string <date-time> (time) Example: insert_time__lt=2018-08-11T09:11:41.674Z The upper insert time excluding boundary. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sources | Array of strings Example: sources=cam1,cam2,null Comma-separated list of sources or null. Each event from result will contain one of given sources. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of uuid (string) or strings Example: stream_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of stream IDs or null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cities | Array of strings Example: cities=Moscow,New York,null Comma-separated list of cities or null. Each event from result will contain one of given cities in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
areas | Array of strings Example: areas=CAD,Manhattan,null Comma-separated list of areas or null. Each event from result will contain one of given areas in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
districts | Array of strings Example: districts=Mitino,Midtown,null Comma-separated list of districts or null. Each event from result will contain one of given districts in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
streets | Array of strings Example: streets=Arbat,West 48th street,null Comma-separated list of streets or null. Each event from result will contain one of given streets in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
house_numbers | Array of strings Example: house_numbers=1,220,null Comma-separated list of house numbers or null. Each event from result will contain one of given house numbers in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
longitude (number) or null_filter (string) Example: origin_longitude=36.616 Longitude origin in degrees, a part of composite geo position filter or null for undefined geo position. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. Null filter applied only if origin_longitude or origin_latitude is set to 'null', and longitude_delta and latitude_delta is not set. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
latitude (number) or null_filter (string) Example: origin_latitude=55.752 Latitude origin in degrees, a part of composite geo position filter or null for undefined geo position. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. Null filter applied only if origin_longitude or origin_latitude is set to 'null', and longitude_delta and latitude_delta is not set. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
longitude_delta | number (longitude_delta) [ 0 .. 90 ] Default: 0.01 Example: longitude_delta=0.01 Longitude delta in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. If both origin_longitude and origin_latitude are set and longitude_delta is not set - the default value is applied. WARNING: Bounding boxes with a vertex or border on the International Date Line (IDL) or the North or South pole are not fully supported due to features of database spatial index - filter result may be unexpected. NOTE: highly recommended for citywide use only. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
latitude_delta | number (latitude_delta) [ 0 .. 90 ] Default: 0.01 Example: latitude_delta=0.01 Latitude delta in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. If both origin_longitude and origin_latitude are set and latitude_delta is not set - the default value is applied. WARNING: Bounding boxes with a vertex or border on the International Date Line (IDL) or the North or South pole are not fully supported due to features of database spatial index - filter result may be unexpected. NOTE: highly recommended for citywide use only. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
top_matching_candidates_label | string Example: top_matching_candidates_label=matching_label Top matching candidates label. Each event from result will contain given label. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
top_similar_object_ids | Array of strings (external_id) [ items <= 36 characters ] Example: top_similar_object_ids=14159261415926 Comma-separated list of top similar object IDs. Each event from result will contain one of given top similar object IDs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
top_similar_external_ids | Array of strings <uuid> (uuid) Example: top_similar_external_ids=557d54ec-29ad-4f3c-93b4-c9092ef12515 Comma-separated list of top similar external IDs. Each event from result will contain one of given top similar external IDs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
top_similar_object_similarity__gte | number Example: top_similar_object_similarity__gte=0.5 Top similar object similarity lower included bound. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
top_similar_object_similarity__lt | number Example: top_similar_object_similarity__lt=0.5 Top similar object similarity upper excluded bound. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
age__lt | integer Example: age__lt=50 Age upper excluded bound. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
age__gte | integer Example: age__gte=50 Age lower included bound. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
integer or null_filter (string) Example: gender=1 Gender. 1 - male, 0 - female, "null" - null value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of integers or null_filter (string) Example: emotions=1,2,3,null Comma-separated list of predominant emotions or null. Each event from result will contain one of the given emotions.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of integers or null_filter (string) Example: masks=1,2,3,null Comma-separated list of predominant masks or null. Each event from result will contain one of the given mask state.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of integers or null_filter (string) Example: ethnic_groups=1,2,null Comma-separated list of dominant ethnic group or null. Each event from result will contain one of the given ethnic groups.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of integers or null_filter (string) Example: liveness=1,2,null Comma-separated list of dominant liveness or null. Each event from result will contain one of the given liveness.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of integers or null_filter (string) Example: deepfake=0,null Comma-separated list of dominant deepfakes or null. Each event from result will contain one of the given deepfake.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of integers or null_filter (string) Example: apparent_gender=1 Comma-separated list of apparent gender: 0 - female, 1 - male, 2 - undefined, "null" - null value. Each event from result will contain one of the given states. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apparent_age__gte | integer [ 0 .. 100 ] Example: apparent_age__gte=50 Apparent age lower included bound. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apparent_age__lt | integer [ 0 .. 100 ] Example: apparent_age__lt=50 Apparent age upper excluded bound. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of integers or null_filter (string) Example: headwear_states=1 Comma-separated list of headwear states: 0 - absent, 1 - present, 2 - undefined, "null" - null value. Each event from result will contain one of the given states. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of headwear_color (string) or null_filter (string) Example: headwear_apparent_colors=white,undefined,null Comma-separated list of headwear apparent colors or null value. Each event from result will contain one of the given states. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sleeve_lengths | Array of strings Items Enum: "short" "long" "undefined" null Example: sleeve_lengths=short,null Comma-separated list of sleeve length states or null value. Each event from result will contain one of the given states. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of clothing_color (strings) or null_filter (string) Example: upper_clothing_colors=black,white Comma-separated list of upper clothing colors or null for not specified colors. Each event from result will contain at least one of the given clothing colors. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of clothing_color (strings) or null_filter (string) Example: lower_garment_colors=black,white Comma-separated list of lower garment colors. Each event from result will contain at least one of the given clothing colors. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lower_garment_types | Array of strings Items Enum: "undefined" "trousers" "shorts" "skirt" Example: lower_garment_types=trousers,undefined,null Comma-separated list of lower garment types. Each event from result will contain one of the given types. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of shoes_color (string) or null_filter (string) Example: shoes_apparent_colors=white,undefined,null Comma-separated list of shoes apparent colors or null value. Each event from result will contain one of the given states. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of integers or null_filter (string) Example: backpack_states=1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
face_ids | Array of strings <uuid> (uuid) Example: face_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of face IDs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_ids | Array of strings <uuid> (uuid) Example: event_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of event IDs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_id__gte | string <uuid> Example: event_id__gte=8950722f-3fd4-4223-b48f-03f95f0e8dfb Event ID lower included bound. Events in response will be sorted by their ids. If neither event_id__lt or event_id__gte is specified, the faces will be sorted by creation time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_id__lt | string <uuid> Example: event_id__lt=346a5645-ec89-4806-820a-dbcb6e0dc381 Event ID upper excluded bound. Events in response will be sorted by their ids. If neither event_id__lt or event_id__gte is specified, the faces will be sorted by creation time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
handler_ids | Array of strings <uuid> (uuid) Example: handler_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of handler IDs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
external_ids | Array of strings <uuid> (uuid) Example: external_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of external IDs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
user_data | string Example: user_data=user_data_text Find all objects with | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
tags | Array of strings (tag) >= 0 items [ items <= 36 characters ] Example: tags=tag_1,tag_2 Comma-separated list of tags. Each event from result will contain all of given tags. Each tag can be at most 36 characters. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of strings or null_filter (string) Example: track_ids=track_id_number_1,track_id_number_2,null Comma-separated list of track IDs. Each event from result will contain one of given track IDs. Each track ID can be at most 36 characters. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
string or null_filter (string) Example: meta.field_1__gt:numeric=36.6&meta.field_2.field_3__in=value,none&meta.field_4:integer=5 User-defined event meta's filters. Parameter name pattern: Path to field is a dotted event meta's json field path. Field comparison operator is optional one of Field data type is optional one of Allowed usage of filters is:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
order | string Default: "desc" Enum: "asc" "desc" Sort order. If "desc" is set, the newest events will be shown first. If "asc" is set, the oldest events will be shown first. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" params = { "age__lt": 90, "cities": "New York,Moscow", "track_ids": "There_and_Back_Again,Around_the_World", "emotions": "3,4,5,6,7", } headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/events" response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "events": [
- {
- "create_time": "2020-10-11T09:11:41.674Z",
- "end_time": "2020-10-11T09:11:42.674Z",
- "event_id": "bd6df8ea-1df2-449d-b8e3-d1d40b215dc8",
- "handler_id": "791f002e-919c-459d-b766-cba9f4130853",
- "face_id": "e88b8804-fedb-4dc3-8a59-171caf416571",
- "account_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "source": "3rd Avenue",
- "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "top_match": {
- "face_id": "a3cd6fd9-75c2-47aa-b2cc-82d6f9792072",
- "similarity": 0.67,
- "label": "good guys",
- "external_id": "external_id_1"
}, - "match_result": [
- {
- "candidates": [
- {
- "event": {
- "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "create_time": "2018-08-11T09:11:41.674Z",
- "external_id": null,
- "user_data": "user data",
- "handler_id": null,
- "source": "cam_1",
- "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
}, - "similarity": 0.63
}
], - "label": "good guy"
}
], - "face_detections": [
- {
- "sample_id": "a3e8716f-70dc-42ad-8428-7a552e800a37",
- "detection": {
- "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}
}, - "detect_time": "2020-10-11T09:11:41.674Z",
- "detect_ts": 123.456,
- "image_origin": null
}
], - "body_detections": [
- {
- "sample_id": "a3e8716f-70dc-42ad-8428-7a552e800a37",
- "detect_time": "2020-10-11T09:11:41.674Z",
- "detect_ts": 123.456,
- "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
], - "attach_result": [
- "24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
- "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
], - "gender": 1,
- "age": 27,
- "emotion": 5,
- "mask": 1,
- "ethnic_group": 3,
- "tags": [
- "good_event"
], - "user_data": "people are strange",
- "location": {
- "city": "New York",
- "area": "Manhattan",
- "district": null,
- "street": "West 48th street",
- "house_number": "220",
- "geo_position": {
- "latitude": -73.9906401596,
- "longitude": 40.7627248564
}
}, - "track_id": "e3ed4e18-2983-418d-879a-825e4517fc6c",
- "liveness": 1,
- "deepfake": 1,
- "body_basic_attributes": {
- "apparent_age": 25,
- "apparent_gender": 0
}, - "upper_body": {
- "headwear": {
- "state": 0,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "short"
}, - "upper_clothing": {
- "colors": [
- "white",
- "black"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "trousers",
- "colors": [
- "white",
- "black"
]
}, - "shoes": {
- "apparent_color": "black"
}
}, - "accessories": {
- "backpack": {
- "state": 0
}
}, - "meta": {
- "foo": "bar"
}
}, - {
- "account_id": "e3ed4e18-2983-418d-879a-825e4517fc6c",
- "create_time": "2021-06-18T21:27:47.500116+03:00",
- "end_time": "2021-06-18T21:27:47.500116+03:00",
- "event_id": "2a7b475f-047a-442f-903f-eb0f632a5f25",
- "external_id": "5d169198-7999-41bc-8233-6f2e752c2b1a",
- "handler_id": "c79134a3-6395-432d-90a1-e877588a9c8f",
- "source": "Zhang_Ziyi",
- "face_id": "665bb0b9-c3d9-400b-86ab-31375e55405a",
- "gender": 0,
- "age": 27,
- "emotion": 4,
- "mask": 3,
- "ethnic_group": 3,
- "user_data": "Zhang_Ziyi",
- "track_id": "42104c78-8983-4ab8-a2ac-24653a7ce66d",
- "attach_result": [
- "35c01353-a71b-4f55-844d-2b4a001f4c5f"
], - "tags": [
- "Rihanna",
- "Top_model"
], - "face_detections": [
- {
- "sample_id": "67487758-fa42-4913-81e1-3750a4a45657",
- "detect_time": "2021-06-18T21:27:47.500116+03:00",
- "detect_ts": 123.456,
- "image_origin": null,
- "detection": {
- "rect": {
- "x": 228,
- "y": 200,
- "width": 413,
- "height": 522
}
}
}
], - "body_detections": null,
- "location": {
- "city": "New York",
- "area": "Manhattan",
- "district": "unknown",
- "street": null,
- "house_number": null,
- "geo_position": {
- "latitude": -73.9906401596,
- "longitude": 40.7627248564
}
}, - "match_result": [
- {
- "label": "11f14560-25c6-4727-b096-7e52a973e350",
- "candidates": [
- {
- "similarity": 0.1134187654,
- "face": {
- "face_id": "af836e01-7f0a-467d-9f91-e69909066f44",
- "user_data": "02e2565a-bd20-46bb-89f4-f7656a8eb0b7",
- "create_time": "2021-06-18T21:27:41.549079+03:00",
- "external_id": "3f8c9b4e-0d96-4617-8698-94b4c7932c0b"
}
}
]
}, - {
- "label": "ac75a600-8bf9-4a02-8bc1-daa8eeb0b41e",
- "candidates": [
- {
- "similarity": 0.0251344983,
- "face": {
- "face_id": "9a27acea-54ec-4f54-8491-12ffa74cc51a",
- "user_data": "851520ac-28d4-445c-8ecd-ced96a949545",
- "create_time": "2021-06-18T21:27:42.374622+03:00",
- "external_id": "77db6ad5-2eac-46eb-9574-52b4cbdeb80c"
}
}
]
}
], - "top_match": {
- "face_id": "af836e01-7f0a-467d-9f91-e69909066f44",
- "label": "11f14560-25c6-4727-b096-7e52a973e350",
- "similarity": 0.1134187654,
- "external_id": "external_id_1"
}, - "liveness": 1,
- "deepfake": 1,
- "body_basic_attributes": {
- "apparent_age": 25,
- "apparent_gender": 0
}, - "upper_body": {
- "headwear": {
- "state": 0,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "short"
}, - "upper_clothing": {
- "colors": [
- "white",
- "black"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "trousers",
- "colors": [
- "white",
- "black"
]
}, - "shoes": {
- "apparent_color": "black"
}
}, - "accessories": {
- "backpack": {
- "state": 0
}
}, - "meta": null
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get event by ID.
The target
parameter determines field that will be shown for specified event. If target is not set, the response will contain all the fields.
event_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Event ID. |
target | Array of strings (events_targets) Items Enum: "event_id" "account_id" "create_time" "end_time" "external_id" "handler_id" "stream_id" "source" "top_match" "match_result" "face_detections" "body_detections" "face_id" "attach_result" "gender" "age" "emotion" "ethnic_group" "tags" "user_data" "location" "mask" "liveness" "deepfake" "track_id" "body_basic_attributes" "upper_body" "lower_body" "accessories" "meta" Example: target=create_time,event_id,face_detections Comma-separated list of event fields. If set, an event from result will contain only specified fields, otherwise, an event with all fields will be returned. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests import time baseUri = "http://127.0.0.1:5000/6" headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/handlers" payload = { "description": "non_dynamic_handler", "policies": {}, "handler_type": 0, } handlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"] with open("image.jpg", "rb") as image_file: image = image_file.read() headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", "Luna-Event-Time": "2020-10-10T09:11:41.674Z", } url = f"{baseUri}/handlers/{handlerId}/events" eventId = requests.post( url, headers=headers, data=image, ).json()["events"][0]["event_id"] # We are waiting for the event to be created time.sleep(5) headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/events/{eventId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "create_time": "2020-10-11T09:11:41.674Z",
- "end_time": "2020-10-11T09:11:41.674Z",
- "event_id": "bd6df8ea-1df2-449d-b8e3-d1d40b215dc8",
- "handler_id": "791f002e-919c-459d-b766-cba9f4130853",
- "face_id": "e88b8804-fedb-4dc3-8a59-171caf416571",
- "account_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "source": "3rd Avenue",
- "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "top_match": {
- "face_id": "a3cd6fd9-75c2-47aa-b2cc-82d6f9792072",
- "similarity": 0.67,
- "label": "good guys",
- "external_id": "external_id_1"
}, - "match_result": [
- {
- "candidates": [
- {
- "event": {
- "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "create_time": "2018-08-11T09:11:41.674Z",
- "external_id": null,
- "user_data": "user data",
- "handler_id": null,
- "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "source": "cam_1"
}, - "similarity": 0.63
}
], - "label": "good guy"
}
], - "face_detections": [
- {
- "sample_id": "a3e8716f-70dc-42ad-8428-7a552e800a37",
- "detection": {
- "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}
}, - "detect_time": "2020-10-11T09:11:41.674Z",
- "detect_ts": 123.456,
- "image_origin": null
}
], - "body_detections": [
- {
- "sample_id": "a3e8716f-70dc-42ad-8428-7a552e800a37",
- "detect_time": "2020-10-11T09:11:41.674Z",
- "detect_ts": 123.456,
- "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
], - "attach_result": [
- "24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
- "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
], - "gender": 1,
- "age": 27,
- "emotion": 5,
- "mask": 1,
- "ethnic_group": 3,
- "tags": [
- "good_event"
], - "user_data": "people are strange",
- "location": {
- "city": "New York",
- "area": "Manhattan",
- "district": null,
- "street": "West 48th street",
- "house_number": "220",
- "geo_position": {
- "latitude": -73.9906401596,
- "longitude": 40.7627248564
}
}, - "track_id": "e3ed4e18-2983-418d-879a-825e4517fc6c",
- "body_basic_attributes": {
- "apparent_age": 25,
- "apparent_gender": 0
}, - "upper_body": {
- "headwear": {
- "state": 0,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "short"
}, - "upper_clothing": {
- "colors": [
- "white",
- "black"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "trousers",
- "colors": [
- "white",
- "black"
]
}, - "shoes": {
- "apparent_color": "black"
}
}, - "accessories": {
- "backpack": {
- "state": 0
}
}, - "meta": {
- "foo": "bar"
}
}
Check if event with event_id
exists.
event_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Event ID. |
target | Array of strings (events_targets) Items Enum: "event_id" "account_id" "create_time" "end_time" "external_id" "handler_id" "stream_id" "source" "top_match" "match_result" "face_detections" "body_detections" "face_id" "attach_result" "gender" "age" "emotion" "ethnic_group" "tags" "user_data" "location" "mask" "liveness" "deepfake" "track_id" "body_basic_attributes" "upper_body" "lower_body" "accessories" "meta" Example: target=create_time,event_id,face_detections Comma-separated list of event fields. If set, an event from result will contain only specified fields, otherwise, an event with all fields will be returned. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests import time baseUri = "http://127.0.0.1:5000/6" headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/handlers" payload = { "description": "non_dynamic_handler", "policies": {}, "handler_type": 0, } handlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"] # emit event with open("image.jpg", "rb") as image_file: image = image_file.read() headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", "Content-Type": "image/jpeg", "Luna-Event-Time": "2020-10-10T09:11:41.674Z", } url = f"{baseUri}/handlers/{handlerId}/events" eventId = requests.post( url, headers=headers, data=image, ).json()["events"][0]["event_id"] # We are waiting for the event to be created time.sleep(5) headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/events/{eventId}" response = requests.head(url, headers=headers) print(response.status_code)
Get options for the resource.
event_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Event ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get general event statistics by target(s) with applied filters.
Event fields and/or functions (count, min, etc.) can be set as targets for aggregation of general events.
Grouping by frequency or grouping by time intervals is available.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
Array of objects non-empty Default: [{"column":"event_id","aggregator":"count"}] Fields and functions to aggregate. Allowed usage of aggregators is:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of objects >= 0 items Set of filters for sample restriction. Allowed usage of filters is:
Warning: must be at least one aggregator different with 'group_by' in request | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of objects (periods) >= 0 items Specifies the period of event creation. All the events created during this period will be included in the statistics. You can set the start and end of the period or only one of the bounds.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
group_by | string (group_by) Enables you to group events by creation time according to one of two ways:
|
{- "targets": [
- {
- "column": "event_id",
- "aggregator": "count"
}
], - "filters": [
- {
- "column": "event_type",
- "operator": "eq",
- "value": "sample_event_type"
}, - {
- "column": "source",
- "operator": "eq",
- "value": "Main_hall_camera"
}, - {
- "column": "geo_position",
- "operator": "covered",
- "value": {
- "origin_longitude": 37,
- "origin_latitude": 55,
- "longitude_delta": 0.04,
- "latitude_delta": 0.04
}
}
], - "period": [
- {
- "operator": "gt",
- "value": "2020-02-04T00:00:00Z"
}, - {
- "operator": "lt",
- "value": "2020-02-06T00:00:00Z"
}
], - "group_by": "dayOfWeek"
}
{- "fields": [
- "Group by time: dayOfWeek",
- "event_type, aggregator 'group_by'",
- "stream_id, aggregator 'group_by'",
- "event_id, aggregator 'count'"
], - "stats": [
- [
- "Tuesday",
- "my-shiny-event-foo",
- "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
- 45
], - [
- "Tuesday",
- "my-shiny-event-foo",
- "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
- 23
], - [
- "Tuesday",
- "my-shiny-event-bar",
- "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
- 45
], - [
- "Wednesday",
- "my-shiny-event-foo",
- "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
- 34
], - [
- "Wednesday",
- "my-shiny-event-bar",
- "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
- 345
]
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get general events that satisfy filters.
Default filters for events:
event_create_time__lt
- current date and timeevent_create_time__gte
- current date and time minus monthDefault filters are not used if any of the following parameters are defined:
- list of event IDs (`event_ids`)
- lower event ID boundary (`event_id__gte`)
- upper event ID boundary (`event_id__lt`)
- lower create time boundary (`event_create_time__gte`)
- upper create time boundary (`event_create_time__lt`)
event_type | Array of strings[ items <= 36 characters ] Example: event_type=my-shiny-event Comma-separated list of general event types. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_create_time__gte | string <date-time> (time) Example: event_create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_create_time__lt | string <date-time> (time) Example: event_create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_end_time__gte | string <date-time> (time) Example: event_end_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object end_time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_end_time__lt | string <date-time> (time) Example: event_end_time__lt=2018-08-11T09:11:41.674Z Upper bound for object end_time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
insert_time__gte | string <date-time> (time) Example: insert_time__gte=2018-08-11T09:11:41.674Z The lower insert time including boundary. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
insert_time__lt | string <date-time> (time) Example: insert_time__lt=2018-08-11T09:11:41.674Z The upper insert time excluding boundary. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sources | Array of strings Example: sources=cam1,cam2,null Comma-separated list of sources or null. Each event from result will contain one of given sources. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_ids | Array of strings <uuid> (uuid) Example: event_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of event IDs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_id__gte | string <uuid> Example: event_id__gte=8950722f-3fd4-4223-b48f-03f95f0e8dfb Event ID lower included bound. Events in response will be sorted by their ids. If neither event_id__lt or event_id__gte is specified, the faces will be sorted by creation time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_id__lt | string <uuid> Example: event_id__lt=346a5645-ec89-4806-820a-dbcb6e0dc381 Event ID upper excluded bound. Events in response will be sorted by their ids. If neither event_id__lt or event_id__gte is specified, the faces will be sorted by creation time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of uuid (string) or strings Example: stream_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of stream IDs or null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of strings or null_filter (string) Example: track_ids=track_id_number_1,track_id_number_2,null Comma-separated list of track IDs. Each event from result will contain one of given track IDs. Each track ID can be at most 36 characters. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cities | Array of strings Example: cities=Moscow,New York,null Comma-separated list of cities or null. Each event from result will contain one of given cities in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
areas | Array of strings Example: areas=CAD,Manhattan,null Comma-separated list of areas or null. Each event from result will contain one of given areas in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
districts | Array of strings Example: districts=Mitino,Midtown,null Comma-separated list of districts or null. Each event from result will contain one of given districts in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
streets | Array of strings Example: streets=Arbat,West 48th street,null Comma-separated list of streets or null. Each event from result will contain one of given streets in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
house_numbers | Array of strings Example: house_numbers=1,220,null Comma-separated list of house numbers or null. Each event from result will contain one of given house numbers in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
longitude (number) or null_filter (string) Example: origin_longitude=36.616 Longitude origin in degrees, a part of composite geo position filter or null for undefined geo position. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. Null filter applied only if origin_longitude or origin_latitude is set to 'null', and longitude_delta and latitude_delta is not set. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
latitude (number) or null_filter (string) Example: origin_latitude=55.752 Latitude origin in degrees, a part of composite geo position filter or null for undefined geo position. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. Null filter applied only if origin_longitude or origin_latitude is set to 'null', and longitude_delta and latitude_delta is not set. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
longitude_delta | number (longitude_delta) [ 0 .. 90 ] Default: 0.01 Example: longitude_delta=0.01 Longitude delta in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. If both origin_longitude and origin_latitude are set and longitude_delta is not set - the default value is applied. WARNING: Bounding boxes with a vertex or border on the International Date Line (IDL) or the North or South pole are not fully supported due to features of database spatial index - filter result may be unexpected. NOTE: highly recommended for citywide use only. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
latitude_delta | number (latitude_delta) [ 0 .. 90 ] Default: 0.01 Example: latitude_delta=0.01 Latitude delta in degrees, a part of composite geo position filter. Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta. Geo position filter is considered as properly specified if both origin_longitude and origin_latitude are set, and considered as properly empty if neither of origin_longitude, origin_latitude, longitude_delta, latitude_delta is set. If both origin_longitude and origin_latitude are set and latitude_delta is not set - the default value is applied. WARNING: Bounding boxes with a vertex or border on the International Date Line (IDL) or the North or South pole are not fully supported due to features of database spatial index - filter result may be unexpected. NOTE: highly recommended for citywide use only. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
string or null_filter (string) Example: event.field_1__gt:numeric=36.6&event.field_2.field_3__in=value,none&event.field_4:integer=5 User-defined general events Parameter name pattern: Path to field is a general events Field comparison operator is optional one of Field data type is optional one of Allowed usage of filters is:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
order | string Default: "desc" Enum: "asc" "desc" Sort order. If "desc" is set, the newest events will be shown first. If "asc" is set, the oldest events will be shown first. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
curl --location --request GET 'http://127.0.0.1:5000/6/general/events?cities=New%20York,Moscow&track_ids=There_and_Back_Again,Around_the_World&event.foo=bar' \ --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \ --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
{- "events": [
- {
- "event_type": "my-shiny-event",
- "event_create_time": "2020-10-11T09:11:41.674Z",
- "event_end_time": "2020-10-11T09:11:41.674Z",
- "source": "cam_1",
- "event": {
- "event_id": "bd6df8ea-1df2-449d-b8e3-d1d40b215dc8",
- "track_id": "24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
- "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "location": {
- "city": "New York",
- "area": "Manhattan",
- "district": null,
- "street": "West 48th street",
- "house_number": "220",
- "geo_position": {
- "latitude": -73.9906401596,
- "longitude": 40.7627248564
}
}, - "foo": "bar"
}, - "account_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get general event by ID.
event_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Event ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
{- "event_type": "my-shiny-event",
- "event_create_time": "2020-10-11T09:11:41.674Z",
- "event_end_time": "2020-10-11T09:11:41.674Z",
- "source": "3rd Avenue",
- "event": {
- "event_id": "bd6df8ea-1df2-449d-b8e3-d1d40b215dc8",
- "track_id": "24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
- "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "location": {
- "city": "New York",
- "area": "Manhattan",
- "district": null,
- "street": "West 48th street",
- "house_number": "220",
- "geo_position": {
- "latitude": -73.9906401596,
- "longitude": 40.7627248564
}
}, - "foo": "bar"
}, - "account_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
}
Check if general event exists.
event_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Event ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Get options for the resource.
event_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Event ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a clustering task.
The Filters section specifies which faces (or events) should be added to the cluster. The filters are combined with logical AND.
Available filters depend on the object type: events or faces.
You can receive a report about the finished clustering task using the reporter task.
Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.
If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.
Objects to be processed must belong to the user account making the request.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
object (notification_policy) Tasks processing notification policy. | |
object (result_storage_policy) tasks processing result storage policy | |
description | string (task_description) <= 128 characters Task description. |
required | object (clustering_task_content) Clustering task content. |
{- "notification_policy": {
- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}, - "result_storage_policy": {
- "ttl": 7
}, - "description": "task description",
- "content": {
- "filters": {
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "account_id": "string"
}, - "objects_type": "faces",
- "params": {
- "use_track_info": 0
}, - "threshold": 0.5,
- "descriptor": {
- "type": "face"
}, - "limit": 3
}
}
{- "task_id": 17
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a task report in CSV format.
Now the report is only created for clustering tasks.
The report contains additional information about clustering objects (faces or events). You can specify additional information that will be added to the report. The first and the second columns in the report always correspond to a cluster number and an object ID.
Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results. The result is returned in ZIP archive, which contains a CSV file. If you set the save_images
parameter, then the ZIP archive will also contain a folder with images.
If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.
Objects to be processed must belong to the user account making the request.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
object (notification_policy) Tasks processing notification policy. | |
object (result_storage_policy) tasks processing result storage policy | |
description | string (task_description) <= 128 characters Task description. |
required | object (reporter_task_content) Reporter task content. |
{- "notification_policy": {
- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}, - "result_storage_policy": {
- "ttl": 7
}, - "description": "task description",
- "content": {
- "columns": [
- "face_id",
- "user_data",
- "create_time"
], - "csv_delimiter": "$",
- "save_images": 1,
- "filters": {
- "task_id": 146,
- "account_id": "string"
}
}
}
{- "task_id": 17
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Collect event and/or face data and export them from LP to a CSV file. The file rows represent requested objects. Corresponding samples (if they were requested) are also returned.
Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results. The result is returned in ZIP archive, which contains a CSV file. If you set the save_images
parameter, then the ZIP archive will also contain a folder with images.
If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.
Objects to be processed must belong to the user account making the request.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
object (notification_policy) Tasks processing notification policy. | |
object (result_storage_policy) tasks processing result storage policy | |
description | string (task_description) <= 128 characters Task description. |
required | any Exporter task content. |
{- "notification_policy": {
- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}, - "result_storage_policy": {
- "ttl": 7
}, - "description": "task description",
- "content": {
- "filters": {
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515"
}, - "objects_type": "string",
- "columns": [
- "face_id",
- "user_data",
- "create_time"
], - "descriptor": {
- "type": "face"
}, - "csv_delimiter": "$",
- "save_images": 0
}
}
{- "task_id": 31
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a linker task.
The task enables you to attach faces to the specified list according to the filters.
You can use faces or events as objects for the task. When events are used, new face is created for each of the events.
A list is required for the task processing:
Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.
If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.
Objects to be processed must belong to the user account making the request.
If luna-image-store is disabled no subtask/task result will be stored.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
object (notification_policy) Tasks processing notification policy. | |
object (result_storage_policy) tasks processing result storage policy | |
description | string (task_description) <= 128 characters Task description. |
required | object (linker_task_content) Linker task content. |
{- "notification_policy": {
- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}, - "result_storage_policy": {
- "ttl": 7
}, - "description": "task description",
- "content": {
- "create_list": 1,
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "user_data": "list of good persons",
- "objects_type": "faces",
- "filters": {
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515"
}
}
}
{- "task_id": 29
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a garbage collection task.
Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.
If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.
Objects to be processed must belong to the user account making the request.
WARNING: If you perform the task for faces with the
remove_samples
flag disabled, then the only way to delete samples is to execute the "remove face/body sample" resource.
If luna-image-store is disabled no subtask/task result will be stored.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
object (notification_policy) Tasks processing notification policy. | |
object (result_storage_policy) tasks processing result storage policy | |
description | string (task_description) <= 128 characters Task description. |
required | any (gc_task_content) |
{- "notification_policy": {
- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}, - "result_storage_policy": {
- "ttl": 7
}, - "description": "task description",
- "content": {
- "target": "faces",
- "filters": {
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "user_data": "100-00-12",
- "list_id": "8950722f-3fd4-4223-b48f-03f95f0e8dfb"
}, - "store_results": true,
- "remove_samples": false
}
}
{- "task_id": 25
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a cross-matching task.
The cross-matching task enables you to compare references (faces, attributes or events) with candidates (faces, attributes or events) according to the specified filters.
All the references are matched with all the candidates.
You can limit the number of candidates returned in matching results and set the minimum acceptable similarity threshold.
Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.
If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.
Objects to be processed must belong to the user account making the request.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
object (notification_policy) Tasks processing notification policy. | |
object (result_storage_policy) tasks processing result storage policy | |
description | string (task_description) <= 128 characters Task description. |
required | object (cross_match_task_content) Cross match task content. |
{- "notification_policy": {
- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}, - "result_storage_policy": {
- "ttl": 7
}, - "description": "task description",
- "content": {
- "filters": {
- "reference_filters": {
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "gender": 1,
- "sources": "Main_hall_camera"
}, - "candidate_filters": {
- "create_time__gte": "2018-02-11T09:11:41.674Z",
- "create_time__lt": "2020-02-12T09:11:41.674Z",
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515"
}, - "reference_type": "events",
- "candidate_type": "faces"
}, - "threshold": 0.5,
- "limit": 3
}
}
{- "task_id": 15
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a ROC-curve calculating task.
ROC (or Receiver Operating Characteristic) is a performance measurement for the classification problem at various threshold settings. The ROC-curve is plotted with TPR (True Positive Rate) against the FPR (False Positive Rate).
TPR is a true positive match pair count divided by a count of total expected positive match pairs, and FPR is a false positive match pair count divided by a count of total expected negative match pairs. Each point (FPR, TPR) of the ROC-cure corresponds to a certain similarity threshold.
The model performance is determined by looking at the area under the ROC-curve (or AUC), the ROC-curve and the secondary main diagonal intersection point, where type I and type II error rates are equal. The model performance is also determined by getting into the top-N probability, i.e. probability of getting a positive match pair into the top-N for any match result group sorted by similarity.
Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.
If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.
Objects to be processed must belong to the user account making the request.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
object (notification_policy) Tasks processing notification policy. | |
object (result_storage_policy) tasks processing result storage policy | |
description | string (task_description) <= 128 characters Task description. |
required | object (roc_task_content) ROC-curve calculating task content. |
{- "notification_policy": {
- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}, - "result_storage_policy": {
- "ttl": 7
}, - "description": "task description",
- "content": {
- "markup": [
- {
- "face_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "label": 12
}, - {
- "face_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "label": 12
}
], - "filters": {
- "account_id": "string"
}, - "threshold_hit_top": 0.95,
- "limit": 100,
- "key_FPRs": [
- 0.000001,
- 0.001
]
}
}
{- "task_id": 14
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create an estimator task.
Task allows to process images using established policies. Policies can be specified in the request or use saved ones by passing the handler ID.
The resource can accept three types of sources with images for processing:
Use the GET request on resource "/6/tasks/{task_id}/result" to receive the task results.
If there are no results of the created task and error "Object not found" is returned, use the GET request on resource "/6/tasks/errors/{error_id}" to receive the task errors.
WARNING: Check handler
storage_policy
before a task start,notification_policy
andevent_policy
enable by default.
Objects to be processed must belong to the user account making the request.
If luna-image-store is disabled no subtask/task result will be stored.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
object (notification_policy) Tasks processing notification policy. | |
object (result_storage_policy) tasks processing result storage policy | |
description | string (task_description) <= 128 characters Task description. |
required | object (estimator_task_content) Estimator task content. |
{- "description": "estimator task with zip archive",
- "content": {
- "handler": {
- "handler_id": "c42ad7cb-9078-4be4-8457-4d3c744477df"
}, - "source": {
- "source_type": "zip",
- "reference": {
- "prefix": "folder_in_archive/some_prefix",
- "postfix": ".jpg"
}, - "recursive": true,
- "authorization": {
- "password": 123456
}, - "image_type": 1
}
}, - "notification_policy": {
- "enable": 1,
- "task_callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json"
}, - "enable": 1
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json"
}, - "enable": 1
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}
}
{- "task_id": 123
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create new lambda task.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
object (notification_policy) Tasks processing notification policy. | |
object (result_storage_policy) tasks processing result storage policy | |
description | string (task_description) <= 128 characters Task description. |
required | object (lambda_task_content) Lambda task content. |
{- "notification_policy": {
- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}, - "result_storage_policy": {
- "ttl": 7
}, - "description": "task description",
- "content": {
- "lambda_id": "string",
- "lambda task content fields1": null,
- "lambda task content fields2": null
}
}
{- "task_id": 123
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get tasks according to the filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization | ||||||||||||||||||||||||
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 | ||||||||||||||||||||||||
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 | ||||||||||||||||||||||||
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. | ||||||||||||||||||||||||
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. | ||||||||||||||||||||||||
end_time__lt | string <date-time> (time) Example: end_time__lt=2018-08-11T09:11:41.674Z Upper bound for object end_time. | ||||||||||||||||||||||||
end_time__gte | string <date-time> (time) Example: end_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object end_time. | ||||||||||||||||||||||||
task_ids | string (taskIds) Example: task_ids=1,2,3 Comma-separated task IDs. | ||||||||||||||||||||||||
task_type | integer (task_type) Enum: 0 1 2 3 4 5 6 7 8 9 10 Example: task_type=1 Task type.
| ||||||||||||||||||||||||
task_status | integer (taskStatus) Enum: 0 1 2 3 4 5 Example: task_status=1 Task status.
| ||||||||||||||||||||||||
schedule_id | integer (schedule_id) >= 1 Schedule according to which the task was created |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/gc" payload = {"content": {"target": "events"}} taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } params = { "task_id": taskId, "task_type": 4, "task_status": 5, "create_time__gte": "2018-08-11T09:11:41.674Z", "page": 1, } url = f"{baseUri}/tasks" response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "tasks": [
- {
- "task_id": 27,
- "account_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "create_time": "2018-08-11T09:11:41.674Z",
- "end_time": null,
- "last_update_time": "2018-08-11T09:11:41.674Z",
- "task_type": 6,
- "task_status": 1,
- "result_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "count_task_parts_done": 10,
- "count_task_parts_all": 100,
- "content": {
- "filters": {
- "account_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "reference_type": "events",
- "candidate_type": "faces",
- "reference_filters": {
- "gender": 1,
- "sources": [
- "Main_hall_camera"
]
}, - "candidate_filters": {
- "attribute_ids": [
- "83914110-cba3-46da-8dbe-e6e7a7aa2466",
- "9027e290-db5a-43b0-9454-848ad377d428"
]
}
}, - "threshold": 0.5,
- "limit": 3
}, - "description": "task description",
- "schedule_id": 13,
- "notification_policy": {
- "enable": 1,
- "task_callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json"
}, - "enable": 1
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json"
}, - "enable": 1
}
]
}, - "result_storage_policy": { }
}, - {
- "task_id": 13,
- "create_time": "2018-10-11T09:11:41.755Z",
- "account_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "end_time": "2018-10-11T10:15:41.700Z",
- "last_update_time": "2018-10-11T09:11:41.755Z",
- "task_type": 2,
- "task_status": 5,
- "result_id": "3d69b8c3-8465-4eca-8a27-c5a30cd83e3d",
- "count_task_parts_done": 10,
- "count_task_parts_all": 10,
- "content": {
- "filters": {
- "account_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}, - "objects_type": "events",
- "threshold": 0.61,
- "params": {
- "use_track_info": 1
}, - "descriptor": {
- "type": "face"
}
}, - "description": "task description",
- "schedule_id": 13,
- "notification_policy": {
- "enable": 1,
- "task_callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json"
}, - "enable": 1
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json"
}, - "enable": 1
}
]
}, - "result_storage_policy": {
- "ttl": 7
}
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Count tasks according to the filters.
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. | ||||||||||||||||||||||||
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. | ||||||||||||||||||||||||
end_time__lt | string <date-time> (time) Example: end_time__lt=2018-08-11T09:11:41.674Z Upper bound for object end_time. | ||||||||||||||||||||||||
end_time__gte | string <date-time> (time) Example: end_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object end_time. | ||||||||||||||||||||||||
task_ids | string (taskIds) Example: task_ids=1,2,3 Comma-separated task IDs. | ||||||||||||||||||||||||
task_type | integer (task_type) Enum: 0 1 2 3 4 5 6 7 8 9 10 Example: task_type=1 Task type.
| ||||||||||||||||||||||||
task_status | integer (taskStatus) Enum: 0 1 2 3 4 5 Example: task_status=1 Task status.
| ||||||||||||||||||||||||
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization | ||||||||||||||||||||||||
schedule_id | integer (schedule_id) >= 1 Schedule according to which the task was created |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/gc" payload = {"content": {"target": "events"}} taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } params = { "task_id": taskId, "task_type": 4, "task_status": 5, "create_time__gte": "2018-08-11T09:11:41.674Z", "page": 1, } url = f"{baseUri}/tasks/count" response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "count": 13
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get task by ID.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/gc" payload = {"content": {"target": "events"}} taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/{taskId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "task_id": 13,
- "account_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "create_time": "2018-08-11T09:11:41.674Z",
- "end_time": "2018-08-11T10:11:41.674Z",
- "last_update_time": "2018-08-11T10:11:41.674Z",
- "task_type": 1,
- "task_status": 5,
- "result_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "count_task_parts_done": 10,
- "count_task_parts_all": 10,
- "content": {
- "filters": {
- "account_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}, - "objects_type": "faces",
- "user_data": "some info",
- "list_id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
- "create_list": 1
}, - "notification_policy": {
- "enable": 1,
- "task_callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json"
}, - "enable": 1
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json"
}, - "enable": 1
}
]
}, - "result_storage_policy": {
- "ttl": -1
}, - "description": "task description"
}
Cancel task by ID.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/gc" payload = {"content": {"target": "events"}} taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/{taskId}" response = requests.patch(url, headers=headers) print(response.status_code)
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Delete a task and the task results by the task ID.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/gc" payload = {"content": {"target": "events"}} taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/{taskId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Get options for the resource.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get task result by the task ID.
In addition to the result of the task, the occurred errors can be returned in the response.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests import time baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/gc" payload = {"content": {"target": "events"}} taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] # wait for tasks to complete time.sleep(5) headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/{taskId}/result" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "result": [
- {
- "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "samples": [
- "ceaef36e-944f-4b80-a110-96b7d82b8b58"
]
}
], - "errors": [ ]
}
Get options for the resource.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get subtasks of a task by ID.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests import time baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/gc" payload = {"content": {"target": "events"}} taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] # wait for tasks to complete time.sleep(5) headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/{taskId}/subtasks" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "subtasks": [
- {
- "subtask_id": 39,
- "task_id": 39,
- "result_id": "d4dd7ffc-b822-4ed1-88ab-dcce36ae6739",
- "create_time": "2020-06-10T01:09:53.973246+03:00",
- "end_time": "2020-06-10T01:09:54.014438+03:00",
- "subtask_status": 4,
- "content": {
- "target": "events",
- "filters": {
- "account_id": "448f50d1-19cd-4c77-9c2f-f6358b2dd385"
}
}
}, - {
- "subtask_id": 1,
- "task_id": 1,
- "result_id": null,
- "create_time": "2021-06-18T22:02:00.435144+03:00",
- "end_time": "2021-06-18T22:02:00.488094+03:00",
- "subtask_status": 3,
- "content": {
- "filters": {
- "list_id": "d94726c8-55c1-4acb-9ee3-7c40b69e1120",
- "account_id": "448f50d1-19cd-4c77-9c2f-f6358b2dd385"
}, - "objects_type": "faces",
- "descriptor": {
- "type": "face"
}
}
}
]
}
Get options for the resource.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get task notification policy by task ID.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/gc" payload = {"content": {"target": "events"}} taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/{taskId}/notification_policy" response = requests.get( url, headers=headers, ) print(response.status_code) print(response.json())
{- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}
Replace task notification policy by task ID.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
enable | integer Default: 0 Enum: 0 1 Whether callbacks enabled or not. |
Array of any (task_callbacks) Callbacks for sending tasks id and status to third party system. Callbacks are executed after task status changed. Sample Output for successful task
Sample Output for failed task
Sample Output for cancelled task
| |
Array of any (subtask_callbacks) Callbacks for sending subtasks id, status and number of completed subtasks to third party system. Callbacks are executed after task status changed. Sample Output for start subtask
Sample Output for successful subtask
Sample Output for failed subtask
Sample Output for cancelled subtask
|
{- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Get options for the resource.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get errors of a task by the task ID.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests import time from uuid import uuid4 baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "description": "matching famous people with customers", "content": { "markup": [ {"face_id": str(uuid4()), "label": 1}, {"face_id": str(uuid4()), "label": 2}, ], }, } url = f"{baseUri}/tasks/roc" taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] # wait for tasks to complete time.sleep(5) headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/{taskId}/errors" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "errors": [
- {
- "error_id": 5808750,
- "task_id": 14980,
- "subtask_id": 69825,
- "error_code": 28010,
- "description": "Objects not found",
- "detail": "Objects for clustering not found (empty set)",
- "additional_info": null,
- "error_time": "2019-04-29T10:53:42.417396+03:00"
}, - {
- "error_id": 9,
- "task_id": 41,
- "subtask_id": 41,
- "error_code": 13003,
- "description": "Object not found",
- "detail": "Image with id 'a75ddc76-e37e-45f5-9a7a-93e4001208fb' not found",
- "additional_info": "f2d470e7-03c1-4cb2-84b5-ea480f00b1f0",
- "error_time": "2020-05-09T04:10:35.279253+03:00"
}
]
}
Get options for the resource.
task_id required | integer (task_id) >= 1 Example: 123 Task ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get errors according to the filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization | ||||||||||||||||||||||||
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 | ||||||||||||||||||||||||
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 | ||||||||||||||||||||||||
task_ids | string (taskIds) Example: task_ids=1,2,3 Comma-separated task IDs. | ||||||||||||||||||||||||
error_code | integer (error_code) Error code. | ||||||||||||||||||||||||
error_ids | string (errorIds) non-empty Example: error_ids=4,5,6 Comma-separated error IDs. | ||||||||||||||||||||||||
error_time__lt | string <date-time> (time) Example: error_time__lt=2018-08-11T09:11:41.674Z Upper bound for object error_time. | ||||||||||||||||||||||||
error_time__gte | string <date-time> (time) Example: error_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object error_time. | ||||||||||||||||||||||||
task_type | integer (task_type) Enum: 0 1 2 3 4 5 6 7 8 9 10 Example: task_type=1 Task type.
| ||||||||||||||||||||||||
status_code | integer (status_code) [ 400 .. 599 ] Example: status_code=500 HTTP status code. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests import time from uuid import uuid4 baseUri = "http://127.0.0.1:5000/6" # create bad task headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "description": "matching famous people with customers", "content": { "markup": [ {"face_id": str(uuid4()), "label": 1}, {"face_id": str(uuid4()), "label": 2}, ], }, } url = f"{baseUri}/tasks/roc" taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] # wait for tasks to complete time.sleep(5) # get tasks error id list headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/{taskId}/errors" response = requests.get(url, headers=headers) errorIds = [ str(error["error_id"]) for error in response.json()["errors"] ] # get error according to the filters headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "errors": [ { "error_id": ",".join(errorIds), "task_id": taskId, "error_time__gte": "2018-08-11T09:11:41.674Z", } ] } url = f"{baseUri}/tasks/errors" response = requests.get(url, headers=headers, json=payload) print(response.status_code) print(response.json())
{- "errors": [
- {
- "error_id": 5808750,
- "task_id": 14980,
- "subtask_id": 69825,
- "error_code": 28010,
- "description": "Objects not found",
- "detail": "Objects for clustering not found (empty set)",
- "additional_info": null,
- "error_time": "2019-04-29T10:53:42.417396+03:00"
}, - {
- "error_id": 9,
- "task_id": 41,
- "subtask_id": 41,
- "error_code": 13003,
- "description": "Object not found",
- "detail": "Image with id 'a75ddc76-e37e-45f5-9a7a-93e4001208fb' not found",
- "additional_info": "f2d470e7-03c1-4cb2-84b5-ea480f00b1f0",
- "error_time": "2020-05-09T04:10:35.279253+03:00"
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Count errors according to the filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization | ||||||||||||||||||||||||
error_time__lt | string <date-time> (time) Example: error_time__lt=2018-08-11T09:11:41.674Z Upper bound for object error_time. | ||||||||||||||||||||||||
error_time__gte | string <date-time> (time) Example: error_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object error_time. | ||||||||||||||||||||||||
task_type | integer (task_type) Enum: 0 1 2 3 4 5 6 7 8 9 10 Example: task_type=1 Task type.
| ||||||||||||||||||||||||
status_code | integer (status_code) [ 400 .. 599 ] Example: status_code=500 HTTP status code. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests import time from uuid import uuid4 baseUri = "http://127.0.0.1:5000/6" # create bad task headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "description": "matching famous people with customers", "content": { "markup": [ {"face_id": str(uuid4()), "label": 1}, {"face_id": str(uuid4()), "label": 2}, ], }, } url = f"{baseUri}/tasks/roc" taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] # wait for tasks to complete time.sleep(5) # get tasks error id list headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/{taskId}/errors" response = requests.get(url, headers=headers) errorIds = [ str(error["error_id"]) for error in response.json()["errors"] ] # get error count headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "errors": [ { "error_id": ",".join(errorIds), "task_id": taskId, "error_time__gte": "2018-08-11T09:11:41.674Z", } ] } url = f"{baseUri}/tasks/errors/count" response = requests.get(url, headers=headers, json=payload) print(response.status_code) print(response.json())
{- "count": 18
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get error by ID.
error_id required | integer >= 1 Error ID. |
error_id | integer (errorId) Example: error_id=10 Error ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests import time from uuid import uuid4 baseUri = "http://127.0.0.1:5000/6" # create bad task headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "description": "matching famous people with customers", "content": { "markup": [ {"face_id": str(uuid4()), "label": 1}, {"face_id": str(uuid4()), "label": 2}, ], }, } url = f"{baseUri}/tasks/roc" taskId = requests.post(url, headers=headers, json=payload).json()["task_id"] # wait for tasks to complete time.sleep(5) # get tasks error id list headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/{taskId}/errors" response = requests.get(url, headers=headers) errorId = [ str(error["error_id"]) for error in response.json()["errors"] ][0] url = f"{baseUri}/tasks/errors/{errorId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "error_id": 5808750,
- "task_id": 14980,
- "subtask_id": 69825,
- "error_code": 28010,
- "description": "Objects not found",
- "detail": "Objects for clustering not found (empty set)",
- "additional_info": null,
- "error_time": "2019-04-29T10:53:42.417396+03:00",
}
Get options for the resource.
error_id required | integer >= 1 Error ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a new task schedule.
Execution of scheduled tasks will be regulated according to the trigger and optionally starts one task immediately (see start_immediately parameter in behavior section).
No task from the schedule will be executed if the previous task has not yet been completed.
Permissions for task objects.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
required | any (task_schedulable) Task schedule. |
required | object (schedule_trigger) Task schedule trigger. |
object (schedule_behaviour) Schedule behaviour parameters. |
{- "task": {
- "notification_policy": {
- "enable": 1,
- "task_callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}, - "enable": 1
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "authorization": {
- "type": "basic",
- "login": "string",
- "password": "string"
}, - "url": "../dictionary",
- "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}, - "enable": 1
}
]
}, - "task_type": 4,
- "content": {
- "target": "events",
- "filters": {
- "create_time__lt": "now-30d"
}, - "remove_samples": true,
- "remove_image_origins": true
}
}, - "trigger": {
- "cron": "30 5 * * *",
- "cron_timezone": "utc"
}, - "behaviour": {
- "start_immediately": false,
- "create_stopped": false
}
}
{- "schedule_id": 1
}
Get tasks schedules with filters.
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 | ||||||||||||||||||||||
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 | ||||||||||||||||||||||
task_type | integer (task_type_schedulable_reply) Enum: 1 2 3 4 5 6 7 8 9 10 Example: task_type=1 Task type.
| ||||||||||||||||||||||
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. | ||||||||||||||||||||||
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. | ||||||||||||||||||||||
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } params = { "create_time__lt": "2018-08-11T09:11:41.674Z", "create_time_gte": "2050-08-11T09:11:41.674Z", "task_type": 1, } url = f"{baseUri}/tasks/schedules" response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
[- {
- "schedule_id": 1,
- "task_ids": [
- 1,
- 2,
- 3
], - "account_id": "string",
- "task": {
- "task_type": 1,
- "content": {
- "filters": {
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "account_id": "string",
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515"
}, - "create_list": 1,
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "user_data": "100-00-12",
- "objects_type": "faces"
}, - "notification_policy": {
- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}, - "result_storage_policy": {
- "ttl": 7
}
}, - "trigger": {
- "cron": "5 4 * * *",
- "cron_timezone": "utc"
}, - "status": "running",
- "next_run_time": "2018-08-11T09:11:41.674Z",
- "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z"
}
]
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get tasks schedule by ID.
schedule_id required | integer (schedule_id) >= 1 Schedule according to which the task was created |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" payload = { "task": { "task_type": 1, "content": { "create_list": 1, "objects_type": "faces", "filters": { "create_time__gte": "2018-08-11T09:11:41.674Z" }, }, }, "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"}, "behaviour": {"start_immediately": False, "create_stopped": False} } headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/schedules" response = requests.post(url, headers=headers, json=payload) scheduleId = response.json()["schedule_id"] url = f"{baseUri}/tasks/schedules/{scheduleId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "schedule_id": 1,
- "task_ids": [
- 1,
- 2,
- 3
], - "account_id": "string",
- "task": {
- "task_type": 1,
- "content": {
- "filters": {
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "account_id": "string",
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515"
}, - "create_list": 1,
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "user_data": "100-00-12",
- "objects_type": "faces"
}, - "notification_policy": {
- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}, - "result_storage_policy": {
- "ttl": 7
}
}, - "trigger": {
- "cron": "5 4 * * *",
- "cron_timezone": "utc"
}, - "status": "running",
- "next_run_time": "2018-08-11T09:11:41.674Z",
- "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z"
}
Replace tasks schedule:
if any task created by old schedule is running, it will be cancelled
schedule parameters will be replaced with the new ones
tasks will be executed according to the new schedule
schedule_id required | integer (schedule_id) >= 1 Schedule according to which the task was created |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
required | any (task_schedulable) Task schedule. |
required | object (schedule_trigger) Task schedule trigger. |
object (schedule_behaviour) Schedule behaviour parameters. |
{- "task": {
- "notification_policy": {
- "enable": 0,
- "task_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
], - "subtask_callbacks": [
- {
- "type": "http",
- "enable": 1,
- "authorization": {
- "type": "basic",
- "login": "login",
- "password": "password"
}, - "params": {
- "timeout": 60,
- "content_type": "application/json",
- "headers": { }
}
}, - {
- "type": "telegram",
- "enable": 1,
- "token": "1111111111:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "chat_id": 111111111,
- "params": {
- "timeout": 60
}
}
]
}, - "result_storage_policy": {
- "ttl": 7
}, - "task_type": 1,
- "content": {
- "create_list": 1,
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "user_data": "list of good persons",
- "objects_type": "faces",
- "filters": {
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515"
}
}
}, - "trigger": {
- "cron": "5 4 * * *",
- "cron_timezone": "utc"
}, - "behaviour": {
- "start_immediately": false,
- "create_stopped": false
}
}
{- "schedule_id": 1
}
Pause/start tasks schedule.
schedule_id required | integer (schedule_id) >= 1 Schedule according to which the task was created |
action required | string Enum: "pause" "start" Pause/start tasks schedule. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } # create list url = f"{baseUri}/lists" listId = requests.post(url, headers=headers).json()["list_id"] # create face url = f"{baseUri}/faces" faceId = requests.post(url, headers=headers).json()["face_id"] payload = { "task": { "task_type": 1, "content": { "create_list": 0, "objects_type": "faces", "list_id": listId, "filters": { "face_ids": [faceId], }, }, }, "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"}, "behaviour": {"start_immediately": False, "create_stopped": False} } headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/schedules" response = requests.post(url, headers=headers, json=payload) scheduleId = response.json()["schedule_id"] # Patch schedule params = {"action": "pause"} response = requests.patch(url + f"/{scheduleId}", headers=headers, params=params) print(response.status_code) print(response.json())
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Delete tasks schedule.
schedule_id required | integer (schedule_id) >= 1 Schedule according to which the task was created |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } # create list url = f"{baseUri}/lists" listId = requests.post(url, headers=headers).json()["list_id"] # create face url = f"{baseUri}/faces" faceId = requests.post(url, headers=headers).json()["face_id"] payload = { "task": { "task_type": 1, "content": { "create_list": 0, "objects_type": "faces", "list_id": listId, "filters": { "face_ids": [faceId], }, }, }, "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"}, "behaviour": {"start_immediately": False, "create_stopped": False} } headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/tasks/schedules" response = requests.post(url, headers=headers, json=payload) scheduleId = response.json()["schedule_id"] # Delete schedule payload = {"action": "pause"} response = requests.delete(url + f"/{scheduleId}", headers=headers, json=payload) print(response.status_code)
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Get options for the resource.
schedule_id required | integer (schedule_id) >= 1 Schedule according to which the task was created |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a verifier.
The verifier determines a list of rules for processing and verification of input images.
You can set:
The created handler can be used in "raw verification" and "perform verification" requests.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
description | string <= 128 characters Verifier user description. |
object |
{- "description": "strict verifier",
- "policies": {
- "verification_threshold": 0.9,
- "detect_policy": {
- "multiface_policy": 0,
- "estimate_head_pose": 0,
- "estimate_emotions": 0,
- "estimate_mask": 0,
- "estimate_quality": 0,
- "estimate_gaze": 0,
- "estimate_glasses": 0,
- "estimate_eyes_attributes": 0,
- "estimate_mouth_attributes": 0,
- "detect_landmarks68": 0,
- "extract_exif": 0,
- "yaw_threshold": 180,
- "roll_threshold": 180,
- "pitch_threshold": 180,
- "mask_states": [ ],
- "estimate_liveness": {
- "estimate": 0,
- "liveness_threshold": 0.5,
- "quality_threshold": 0.5
}, - "liveness_states": [ ],
- "estimate_deepfake": {
- "estimate": 0,
- "real_threshold": 0.5,
- "mode": 1
}, - "deepfake_states": [ ],
- "estimate_face_occlusion": {
- "estimate": 0,
- "occlusion_threshold": 0.07,
- "hair_occlusion_threshold": 0.15,
- "forehead_threshold": 0.2,
- "eye_threshold": 0.15,
- "nose_threshold": 0.2,
- "mouth_threshold": 0.15,
- "lower_face_threshold": 0.2
}, - "face_occlusion_states": [ ],
- "face_quality": {
- "estimate": 0,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 0,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "glasses": {
- "estimate": 0,
- "threshold": [
- "no_glasses",
- "eyeglasses"
]
}, - "left_eye": {
- "estimate": 0,
- "threshold": [
- "open"
]
}, - "right_eye": {
- "estimate": 0,
- "threshold": [
- "open"
]
}, - "head_horizontal_center": {
- "estimate": 0,
- "threshold": {
- "min": 0.45,
- "max": 0.55
}
}, - "head_vertical_center": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.5
}
}, - "head_width": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 0.75
}
}, - "head_height": {
- "estimate": 0,
- "threshold": {
- "min": 0.6,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 0,
- "threshold": {
- "min": 91.1,
- "max": 92.2
}
}, - "image_width": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "image_height": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1080
}
}, - "aspect_ratio": {
- "estimate": 0,
- "threshold": {
- "min": 0.74,
- "max": 0.8
}
}, - "face_width": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "face_height": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 0
}
}, - "indent_left": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_right": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_upper": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_lower": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "image_size": {
- "estimate": 0,
- "threshold": {
- "min": 5120,
- "max": 2097152
}
}, - "eyebrows_state": {
- "estimate": 0,
- "threshold": [
- "neutral"
]
}, - "headwear_type": {
- "estimate": 0,
- "threshold": [
- "none"
]
}, - "smile_properties": {
- "estimate": 0,
- "threshold": [
- "none"
]
}, - "face_color_type": {
- "estimate": 0,
- "threshold": [
- "color"
]
}, - "natural_light": {
- "estimate": 0,
- "threshold": 0
}, - "red_eyes": {
- "estimate": 0,
- "threshold": 0
}, - "radial_distortion": {
- "estimate": 0,
- "threshold": 0
}, - "illumination_uniformity": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_uniformity": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_lightness": {
- "estimate": 0,
- "threshold": {
- "min": 0.2,
- "max": 1
}
}, - "shoulders_position": {
- "estimate": 0,
- "threshold": [
- "parallel"
]
}, - "face_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "lower_face_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "forehead_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "nose_occlusion": {
- "estimate": 0,
- "threshold": 0
}
}
}
}, - "extract_policy": {
- "extract_basic_attributes": 0,
- "fd_score_threshold": 0.7
}, - "storage_policy": {
- "attribute_policy": {
- "store_attribute": 0
}, - "face_sample_policy": {
- "store_sample": 0
}
}
}
}
{- "verifier_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "url": "/6/verifiers/b5d6fd45-fcca-453d-ac05-3e594054b813",
}
Get verifiers by filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
description | string Records with descriptions similar to this parameter will be processed. |
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/verifiers" payload = { "description": "new verifier", "policies": { "verification_threshold": 0.5, "detect_policy": { "estimate_mask": 1 }, "extract_policy": { "extract_basic_attributes": 1 }, "storage_policy": { "attribute_policy": { "store_attribute": 1 }, "face_sample_policy": { "store_sample": 1, "ttl": 7 } } } } # create verifier requests.post(url, json=payload, headers=headers) # get verifiers response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
[- {
- "verifier_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
- "description": "simple verifier",
- "policies": {
- "verification_threshold": 0.99,
- "detect_policy": {
- "multiface_policy": 0,
- "estimate_head_pose": 0,
- "estimate_emotions": 0,
- "estimate_mask": 0,
- "estimate_quality": 0,
- "estimate_gaze": 0,
- "estimate_eyes_attributes": 0,
- "estimate_mouth_attributes": 0,
- "detect_landmarks68": 0,
- "extract_exif": 0,
- "yaw_threshold": 180,
- "roll_threshold": 180,
- "pitch_threshold": 180,
- "mask_states": [
- 1
], - "estimate_liveness": {
- "estimate": 1,
- "quality_threshold": 0.7,
- "liveness_threshold": 0.7
}, - "liveness_states": [
- 1
], - "estimate_deepfake": {
- "estimate": 1,
- "real_threshold": 0.7,
- "mode": 2
}, - "deepfake_states": [
- 1
], - "estimate_face_occlusion": {
- "estimate": 0,
- "eye_threshold": 0.15,
- "forehead_threshold": 0.2,
- "hair_occlusion_threshold": 0.15,
- "lower_face_threshold": 0.2,
- "mouth_threshold": 0.15,
- "nose_threshold": 0.2,
- "occlusion_threshold": 0.07
}, - "face_occlusion_states": [
- "face"
], - "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.61,
- "max": 1
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.57,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": -8,
- "max": 8
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "glasses": {
- "estimate": 1,
- "threshold": [
- "no_glasses",
- "eyeglasses"
]
}, - "left_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "right_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "head_horizontal_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.45,
- "max": 0.55
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.5
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 0.75
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.6,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 90,
- "max": 1920
}
}, - "image_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "image_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1080
}
}, - "aspect_ratio": {
- "estimate": 1,
- "threshold": {
- "min": 0.74,
- "max": 0.8
}
}, - "face_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "face_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "image_size": {
- "estimate": 1,
- "threshold": {
- "min": 5120,
- "max": 2097152
}
}, - "eyebrows_state": {
- "estimate": 1,
- "threshold": [
- "neutral"
]
}, - "smile_properties": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "headwear_type": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "natural_light": {
- "estimate": 1,
- "threshold": 1
}, - "radial_distortion": {
- "estimate": 1,
- "threshold": 0
}, - "red_eyes": {
- "estimate": 1,
- "threshold": 0
}, - "face_color_type": {
- "estimate": 1,
- "threshold": [
- "color"
]
}, - "illumination_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_lightness": {
- "estimate": 1,
- "threshold": {
- "min": 0.2,
- "max": 1
}
}, - "background_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "lower_face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "forehead_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "nose_occlusion": {
- "estimate": 1,
- "threshold": 0
}
}
}
}, - "extract_policy": {
- "extract_basic_attributes": 1,
- "fd_score_threshold": 0.7
}, - "storage_policy": {
- "attribute_policy": {
- "store_attribute": 0
}, - "face_sample_policy": {
- "store_sample": 0,
- "ttl": 7
}
}
}, - "create_time": "2019-08-24T14:15:22Z",
- "last_update_time": "2019-08-24T14:15:22Z",
- "version": 111
}, - {
- "verifier_id": "a48609f8-860f-412d-abab-9abfdb517e67",
- "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
- "create_time": "2021-06-18T22:05:06.324756+03:00",
- "last_update_time": "2021-06-18T22:05:06.324756+03:00",
- "description": "AAAac93c7fe-cda1-44b3-bcac-2421e3cb5924BBB",
- "policies": {
- "detect_policy": {
- "multiface_policy": 1,
- "estimate_head_pose": 0,
- "estimate_emotions": 0,
- "estimate_mask": 0,
- "estimate_quality": 0,
- "estimate_gaze": 0,
- "estimate_eyes_attributes": 0,
- "estimate_mouth_attributes": 0,
- "detect_landmarks68": 0,
- "extract_exif": 0,
- "pitch_threshold": null,
- "roll_threshold": null,
- "yaw_threshold": null,
- "mask_states": null,
- "estimate_liveness": {
- "estimate": 0,
- "quality_threshold": 0.7,
- "liveness_threshold": 0.7
}, - "liveness_states": null,
- "estimate_deepfake": {
- "estimate": 1,
- "real_threshold": 0.7,
- "mode": 2
}, - "deepfake_states": [
- 1
], - "estimate_face_occlusion": {
- "estimate": 0,
- "eye_threshold": 0.15,
- "forehead_threshold": 0.2,
- "hair_occlusion_threshold": 0.15,
- "lower_face_threshold": 0.2,
- "mouth_threshold": 0.15,
- "nose_threshold": 0.2,
- "occlusion_threshold": 0.07
}, - "face_occlusion_states": [
- "face"
], - "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.61,
- "max": 1
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.57,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": -8,
- "max": 8
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "glasses": {
- "estimate": 1,
- "threshold": [
- "no_glasses",
- "eyeglasses"
]
}, - "left_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "right_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "head_horizontal_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.45,
- "max": 0.55
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.5
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 0.75
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.6,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 90,
- "max": 1920
}
}, - "image_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "image_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1080
}
}, - "aspect_ratio": {
- "estimate": 1,
- "threshold": {
- "min": 0.74,
- "max": 0.8
}
}, - "face_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "face_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "image_size": {
- "estimate": 1,
- "threshold": {
- "min": 5120,
- "max": 2097152
}
}, - "eyebrows_state": {
- "estimate": 1,
- "threshold": [
- "neutral"
]
}, - "smile_properties": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "headwear_type": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "natural_light": {
- "estimate": 1,
- "threshold": 1
}, - "radial_distortion": {
- "estimate": 1,
- "threshold": 0
}, - "red_eyes": {
- "estimate": 1,
- "threshold": 0
}, - "face_color_type": {
- "estimate": 1,
- "threshold": [
- "color"
]
}, - "illumination_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_lightness": {
- "estimate": 1,
- "threshold": {
- "min": 0.2,
- "max": 1
}
}, - "background_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "lower_face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "forehead_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "nose_occlusion": {
- "estimate": 1,
- "threshold": 0
}
}
}
}, - "extract_policy": {
- "extract_basic_attributes": 0,
- "fd_score_threshold": 0
}, - "storage_policy": {
- "attribute_policy": {
- "store_attribute": 0
}, - "face_sample_policy": {
- "store_sample": 0,
- "ttl": 7
}
}, - "verification_threshold": 0.9
}, - "version": 0
}
]
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
This request performs verification of input descriptors.
"Similarity" and "verification status" are returned for each candidate.
"Verification status" is "True" if the received similarity is greater than the verification_threshold (specified in the verifier handler). Hence, the reference and the candidate are considered the same person.
You should specify descriptors as references and candidates for this request.
verifier_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Verifier ID. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Enum: "application/json" "application/msgpack" Format of a request body data. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
required | Array of xpk_file_entity_base64 (object) or sdk_descriptor_entity_base64 (object) or raw_descriptor_entity_base64 (object) non-empty Reference list for verification. |
required | Array of xpk_file_entity_base64 (object) or sdk_descriptor_entity_base64 (object) or raw_descriptor_entity_base64 (object) non-empty Candidates for verification. |
{- "references": [
- {
- "data": "string",
- "id": "string",
- "type": "xpk_file"
}
], - "candidates": [
- {
- "data": "string",
- "id": "string",
- "type": "xpk_file"
}
]
}
{- "matches": [
- {
- "reference_id": "123456s",
- "matches": [
- {
- "candidate_id": "31415926",
- "similarity": 0.5,
- "status": true
}
]
}, - {
- "reference_id": "raw-1",
- "matches": [
- {
- "candidate_id": "candidate",
- "similarity": 0.0210287365,
- "status": false
}, - {
- "candidate_id": "sdk",
- "similarity": 0.0210287365,
- "status": false
}, - {
- "candidate_id": "xpk",
- "similarity": 0.0210287365,
- "status": false
}
]
}
]
}
Get options for the resource.
verifier_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Verifier ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Verify given images and/or descriptors against specified objects set: faces IDs, events IDs, external IDs.
"Similarity" and "verification status" are returned for each candidate.
"Verification status" is "True" if the received similarity is greater than the verification_threshold (specified in the verifier handler). Hence, the reference and the candidate are considered the same person.
The input images are processed according to the specified policies and the received information is returned in the response.
Objects to be processed must belong to the user account making the request.
Notes for incoming data:
verifier_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Verifier ID. |
face_ids | Array of strings <uuid> (uuid) Example: face_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of face IDs. |
event_ids | Array of strings <uuid> (uuid) Example: event_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of event IDs. |
attribute_ids | Array of strings <uuid> (uuid) Example: attribute_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of attribute IDs. |
external_ids | Array of strings <uuid> (uuid) Example: external_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of external IDs. |
image_type | integer Default: 0 Enum: 0 1 Image type of input image. 0 - raw image, 1 - face warped image. |
use_exif_info | integer Default: 1 Enum: 0 1 Example: use_exif_info=1 Whether to try to auto orient image based on EXIF data. The processed image should have EXIF data, otherwise auto orientation will not be performed. Has no effect with tiff images (they're always auto oriented). Ignored with warped images (see |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Enum: "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "multipart/form-data" "application/json" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64" "application/x-sdk-descriptor" "application/x-sdk-descriptor-base64" "application/x-vl-xpk" "application/x-vl-xpk-base64" |
{- "images": [
- {
- "error": {
- "error_code": 0,
- "detail": "Success",
- "desc": "Success",
}, - "status": 1,
- "filename": "penelope.jpeg",
- "exif": {
- "make": "Apple",
- "model": "iPhone 11",
- "gps": {
- "latitude": "55.0, 45.0, 18.29",
- "longitude": "37.0, 39.0, 16.32"
}, - "software": "13.6.1",
- "orientation": 6
}, - "detections": {
- "face_detections": [
- {
- "verifications": [
- {
- "similarity": 0.5,
- "status": true,
- "face": {
- "face_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
}
], - "face_attributes": {
- "attribute_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "basic_attributes": {
- "age": 29,
- "gender": 1,
- "ethnicities": {
- "estimations": {
- "african_american": 1.92238889737406e-12,
- "asian": 0.954671621322632,
- "caucasian": 0.045328326523304,
- "indian": 7.65100649502415e-10
}, - "predominant_ethnicity": "asian"
}
}, - "score": 0,
- "url": "/6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
- "samples": [
- "a3e8716f-70dc-42ad-8428-7a552e800a37"
]
}, - "sample": {
- "face": {
- "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}, - "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "url": "/6/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c",
- "attributes": {
- "mouth_attributes": {
- "occluded": 0,
- "opened": 0.1,
- "score": 0.999999165534973,
- "smile": 0.2
}, - "emotions": {
- "estimations": {
- "anger": 0.00894705578684807,
- "disgust": 0.00000965219624049496,
- "fear": 0.00121302821207792,
- "happiness": 0.00129503419157118,
- "neutral": 0.986027479171753,
- "sadness": 0.00187553185969591,
- "surprise": 0.000632198702078313
}, - "predominant_emotion": "neutral"
}, - "head_pose": {
- "pitch": 18.6827487945557,
- "roll": -10.3542232513428,
- "yaw": 15.4102487564087
}, - "gaze": {
- "pitch": 9.26744079589844,
- "yaw": -19.4657287597656
}
}, - "quality": {
- "light": 0.87,
- "dark": 0.13,
- "illumination": 0.1,
- "specularity": 0.1,
- "blurriness": 0.2
}, - "landmarks5": [
- [
- 72,
- 72
], - [
- 240,
- 240
], - [
- 154,
- 154
], - [
- 119,
- 119
], - [
- 259,
- 259
]
], - "landmarks68": [
- [
- 8,
- 8
], - [
- 14,
- 14
], - [
- 28,
- 28
], - [
- 48,
- 48
], - [
- 72,
- 72
], - [
- 102,
- 102
], - [
- 134,
- 134
], - [
- 168,
- 168
], - [
- 213,
- 213
], - [
- 262,
- 262
], - [
- 306,
- 306
], - [
- 345,
- 345
], - [
- 376,
- 376
], - [
- 392,
- 392
], - [
- 397,
- 397
], - [
- 399,
- 399
], - [
- 394,
- 394
], - [
- 2,
- 2
], - [
- 22,
- 22
], - [
- 50,
- 50
], - [
- 79,
- 79
], - [
- 106,
- 106
], - [
- 165,
- 165
], - [
- 199,
- 199
], - [
- 236,
- 236
], - [
- 278,
- 278
], - [
- 317,
- 317
], - [
- 137,
- 137
], - [
- 136,
- 136
], - [
- 136,
- 136
], - [
- 136,
- 136
], - [
- 119,
- 119
], - [
- 135,
- 135
], - [
- 154,
- 154
], - [
- 174,
- 174
], - [
- 193,
- 193
], - [
- 40,
- 40
], - [
- 57,
- 57
], - [
- 83,
- 83
], - [
- 108,
- 108
], - [
- 84,
- 84
], - [
- 58,
- 58
], - [
- 203,
- 203
], - [
- 222,
- 222
], - [
- 249,
- 249
], - [
- 277,
- 277
], - [
- 258,
- 258
], - [
- 229,
- 229
], - [
- 119,
- 119
], - [
- 130,
- 130
], - [
- 149,
- 149
], - [
- 167,
- 167
], - [
- 185,
- 185
], - [
- 222,
- 222
], - [
- 259,
- 259
], - [
- 232,
- 232
], - [
- 200,
- 200
], - [
- 177,
- 177
], - [
- 155,
- 155
], - [
- 134,
- 134
], - [
- 127,
- 127
], - [
- 152,
- 152
], - [
- 170,
- 170
], - [
- 190,
- 190
], - [
- 250,
- 250
], - [
- 193,
- 193
], - [
- 172,
- 172
], - [
- 152,
- 152
]
], - "face_quality": {
- "status": 0,
- "checks": [
- {
- "name": "image_format",
- "object_value": "JPEG",
- "threshold_value": [
- "JPEG",
- "JPEG2000",
- "PNG"
], - "result": 1
}, - {
- "name": "illumination_quality",
- "object_value": 0.6005162000656128,
- "threshold_value": {
- "min": 0.3,
- "max": 1
}, - "result": 1
}, - {
- "name": "specularity_quality",
- "object_value": 0.7662366628646851,
- "threshold_value": {
- "min": 0.3,
- "max": 1
}, - "result": 1
}, - {
- "name": "blurriness_quality",
- "object_value": 0.9429352283477783,
- "threshold_value": {
- "min": 0.61,
- "max": 1
}, - "result": 1
}, - {
- "name": "dark_quality",
- "object_value": 0.9020983576774597,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "light_quality",
- "object_value": 0.7881984114646912,
- "threshold_value": {
- "min": 0.57,
- "max": 1
}, - "result": 1
}, - {
- "name": "head_yaw",
- "object_value": 2.818983316421509,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_pitch",
- "object_value": 3.816443920135498,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_roll",
- "object_value": 5.434040069580078,
- "threshold_value": {
- "min": -8,
- "max": 8
}, - "result": 1
}, - {
- "name": "gaze_yaw",
- "object_value": -3.773012399673462,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "gaze_pitch",
- "object_value": 0.7140519022941589,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "mouth_smiling",
- "object_value": 0.000290759839117527,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_occluded",
- "object_value": 0.00009619363845558837,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_open",
- "object_value": 0.6226108074188232,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "glasses",
- "object_value": "no_glasses",
- "threshold_value": [
- "no_glasses",
- "eyeglasses"
], - "result": 1
}, - {
- "name": "left_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "right_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "head_horizontal_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.45,
- "max": 0.55
}, - "result": 1
}, - {
- "name": "head_vertical_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.3,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "head_width",
- "object_value": 0.61,
- "threshold_value": {
- "min": 0.5,
- "max": 0.75
}, - "result": 1
}, - {
- "name": "head_height",
- "object_value": 0.71,
- "threshold_value": {
- "min": 0.6,
- "max": 0.9
}, - "result": 1
}, - {
- "name": "eye_distance",
- "object_value": 110,
- "threshold_value": {
- "min": 90,
- "max": null
}, - "result": 1
}, - {
- "name": "image_width",
- "object_value": 1000,
- "threshold_value": {
- "min": 200,
- "max": 1100
}, - "result": 1
}, - {
- "name": "image_height",
- "object_value": 2000,
- "threshold_value": {
- "min": 200,
- "max": 1100
}, - "result": 1
}, - {
- "name": "aspect_ratio",
- "object_value": 0.5,
- "threshold_value": {
- "min": 0.1,
- "max": 1
}, - "result": 1
}, - {
- "name": "face_width",
- "object_value": 500,
- "threshold_value": {
- "min": 400,
- "max": 600
}, - "result": 1
}, - {
- "name": "face_height",
- "object_value": 500,
- "threshold_value": {
- "min": 400,
- "max": 600
}, - "result": 1
}, - {
- "name": "indent_left",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_right",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_upper",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_lower",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "image_size",
- "object_value": 100500,
- "threshold_value": {
- "min": 10,
- "max": 100600
}, - "result": 1
}, - {
- "name": "eyebrows_state",
- "object_value": "neutral",
- "threshold_value": [
- "neutral"
], - "result": 1
}, - {
- "name": "smile_properties",
- "object_value": "smile_lips",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "headwear_type",
- "object_value": "hat",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "natural_light",
- "object_value": 1,
- "threshold_value": 1,
- "result": 1
}, - {
- "name": "radial_distortion",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "red_eyes",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "face_color_type",
- "object_value": "color",
- "threshold_value": [
- "color"
], - "result": 1
}, - {
- "name": "illumination_uniformity",
- "object_value": 0.6305162000656128,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "dynamic_range",
- "object_value": 0.5305162000656128,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}
]
}
}
}
}
], - "filtered_detections": {
- "face_detections": [
- {
- "filter_reasons": [
- {
- "filter_name": "pitch_threshold",
- "object_value": 0,
- "threshold_value": 0
}
], - "detection": {
- "filename": "1.jpg",
- "sample": {
- "detection": {
- "attributes": {
- "mouth_attributes": {
- "occluded": 0,
- "opened": 0.2,
- "score": 0.999999165534973,
- "smile": 0.1
}, - "emotions": {
- "estimations": {
- "anger": 0.00894705578684807,
- "disgust": 0.00000965219624049496,
- "fear": 0.00121302821207792,
- "happiness": 0.00129503419157118,
- "neutral": 0.986027479171753,
- "sadness": 0.00187553185969591,
- "surprise": 0.000632198702078313
}, - "predominant_emotion": "neutral"
}, - "head_pose": {
- "pitch": 18.6827487945557,
- "roll": -10.3542232513428,
- "yaw": 15.4102487564087
}, - "gaze": {
- "pitch": 9.26744079589844,
- "yaw": -19.4657287597656
}
}, - "quality": {
- "light": 0.87,
- "dark": 0.13,
- "illumination": 0.1,
- "specularity": 0.1,
- "blurriness": 0.2
}, - "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}, - "landmarks5": [
- [
- 72,
- 72
], - [
- 240,
- 240
], - [
- 154,
- 154
], - [
- 119,
- 119
], - [
- 259,
- 259
]
], - "landmarks68": [
- [
- 8,
- 8
], - [
- 14,
- 14
], - [
- 28,
- 28
], - [
- 48,
- 48
], - [
- 72,
- 72
], - [
- 102,
- 102
], - [
- 134,
- 134
], - [
- 168,
- 168
], - [
- 213,
- 213
], - [
- 262,
- 262
], - [
- 306,
- 306
], - [
- 345,
- 345
], - [
- 376,
- 376
], - [
- 392,
- 392
], - [
- 397,
- 397
], - [
- 399,
- 399
], - [
- 394,
- 394
], - [
- 2,
- 2
], - [
- 22,
- 22
], - [
- 50,
- 50
], - [
- 79,
- 79
], - [
- 106,
- 106
], - [
- 165,
- 165
], - [
- 199,
- 199
], - [
- 236,
- 236
], - [
- 278,
- 278
], - [
- 317,
- 317
], - [
- 137,
- 137
], - [
- 136,
- 136
], - [
- 136,
- 136
], - [
- 136,
- 136
], - [
- 119,
- 119
], - [
- 135,
- 135
], - [
- 154,
- 154
], - [
- 174,
- 174
], - [
- 193,
- 193
], - [
- 40,
- 40
], - [
- 57,
- 57
], - [
- 83,
- 83
], - [
- 108,
- 108
], - [
- 84,
- 84
], - [
- 58,
- 58
], - [
- 203,
- 203
], - [
- 222,
- 222
], - [
- 249,
- 249
], - [
- 277,
- 277
], - [
- 258,
- 258
], - [
- 229,
- 229
], - [
- 119,
- 119
], - [
- 130,
- 130
], - [
- 149,
- 149
], - [
- 167,
- 167
], - [
- 185,
- 185
], - [
- 222,
- 222
], - [
- 259,
- 259
], - [
- 232,
- 232
], - [
- 200,
- 200
], - [
- 177,
- 177
], - [
- 155,
- 155
], - [
- 134,
- 134
], - [
- 127,
- 127
], - [
- 152,
- 152
], - [
- 170,
- 170
], - [
- 190,
- 190
], - [
- 250,
- 250
], - [
- 193,
- 193
], - [
- 172,
- 172
], - [
- 152,
- 152
]
], - "face_quality": {
- "status": 0,
- "checks": [
- {
- "name": "image_format",
- "object_value": "JPEG",
- "threshold_value": [
- "JPEG",
- "JPEG2000",
- "PNG"
], - "result": 1
}, - {
- "name": "illumination_quality",
- "object_value": 0.6005162000656128,
- "threshold_value": {
- "min": 0.3,
- "max": 0.4
}, - "result": 1
}, - {
- "name": "specularity_quality",
- "object_value": 0.7662366628646851,
- "threshold_value": {
- "min": 0.3,
- "max": 1
}, - "result": 1
}, - {
- "name": "blurriness_quality",
- "object_value": 0.9429352283477783,
- "threshold_value": {
- "min": 0.61,
- "max": 1
}, - "result": 1
}, - {
- "name": "dark_quality",
- "object_value": 0.9020983576774597,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "light_quality",
- "object_value": 0.7881984114646912,
- "threshold_value": {
- "min": 0.57,
- "max": 1
}, - "result": 1
}, - {
- "name": "head_yaw",
- "object_value": 2.818983316421509,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_pitch",
- "object_value": 3.816443920135498,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_roll",
- "object_value": 5.434040069580078,
- "threshold_value": {
- "min": -8,
- "max": 8
}, - "result": 1
}, - {
- "name": "gaze_yaw",
- "object_value": -3.773012399673462,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "gaze_pitch",
- "object_value": 0.7140519022941589,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "mouth_smiling",
- "object_value": 0.000290759839117527,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_occluded",
- "object_value": 0.00009619363845558837,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_open",
- "object_value": 0.6226108074188232,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "glasses",
- "object_value": "no_glasses",
- "threshold_value": [
- "no_glasses",
- "eyeglasses"
], - "result": 1
}, - {
- "name": "left_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "right_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "head_horizontal_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.45,
- "max": 0.55
}, - "result": 1
}, - {
- "name": "head_vertical_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.3,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "head_width",
- "object_value": 0.61,
- "threshold_value": {
- "min": 0.5,
- "max": 0.75
}, - "result": 1
}, - {
- "name": "head_height",
- "object_value": 0.71,
- "threshold_value": {
- "min": 0.6,
- "max": 0.9
}, - "result": 1
}, - {
- "name": "eye_distance",
- "object_value": 110,
- "threshold_value": {
- "min": 90,
- "max": null
}, - "result": 1
}, - {
- "name": "image_width",
- "object_value": 1000,
- "threshold_value": {
- "min": 200,
- "max": 1100
}, - "result": 1
}, - {
- "name": "image_height",
- "object_value": 2000,
- "threshold_value": {
- "min": 200,
- "max": 1100
}, - "result": 1
}, - {
- "name": "aspect_ratio",
- "object_value": 0.5,
- "threshold_value": {
- "min": 0.1,
- "max": 1
}, - "result": 1
}, - {
- "name": "face_width",
- "object_value": 500,
- "threshold_value": {
- "min": 400,
- "max": 600
}, - "result": 1
}, - {
- "name": "face_height",
- "object_value": 500,
- "threshold_value": {
- "min": 400,
- "max": 600
}, - "result": 1
}, - {
- "name": "indent_left",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_right",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_upper",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_lower",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "image_size",
- "object_value": 100500,
- "threshold_value": {
- "min": 10,
- "max": 100600
}, - "result": 1
}, - {
- "name": "eyebrows_state",
- "object_value": "neutral",
- "threshold_value": [
- "neutral"
], - "result": 1
}, - {
- "name": "smile_properties",
- "object_value": "smile_lips",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "headwear_type",
- "object_value": "hat",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "natural_light",
- "object_value": 1,
- "threshold_value": 1,
- "result": 1
}, - {
- "name": "radial_distortion",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "red_eyes",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "face_color_type",
- "object_value": "color",
- "threshold_value": [
- "color"
], - "result": 1
}, - {
- "name": "illumination_uniformity",
- "object_value": 0.7305162000656128,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "dynamic_range",
- "object_value": 0.6305162000656128,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}
]
}
}
}
}
}
]
}
}
}, - {
- "error": {
- "error_code": 0,
- "desc": "Success",
- "detail": "Success",
}, - "status": 1,
- "filename": "raw image",
- "detections": {
- "face_detections": [
- {
- "sample": {
- "face": {
- "url": "null,",
- "sample_id": null,
- "rect": {
- "x": 70,
- "y": 40,
- "width": 135,
- "height": 181
}
}
}, - "verifications": [
- {
- "similarity": 1,
- "status": true,
- "face": {
- "face_id": "d05dd4eb-05e2-4962-9a91-7a665a2b3d67"
}
}, - {
- "similarity": 0.9951737645,
- "status": true,
- "face": {
- "face_id": "ed654332-f8ab-4030-b9bf-654d6790f865"
}
}, - {
- "similarity": 0.9934924273,
- "status": true,
- "face": {
- "face_id": "14abd41f-6fe6-445d-b9eb-95d010c42ca9"
}
}, - {
- "similarity": 0.9912151812,
- "status": true,
- "face": {
- "face_id": "c3618a84-e854-40a3-a12b-8c817652f941"
}
}, - {
- "similarity": 0.9894505146,
- "status": true,
- "face": {
- "face_id": "280e3988-c26a-4cbd-beeb-4dfa9c6e211c"
}
}
], - "face_attributes": {
- "samples": [ ],
- "attribute_id": null,
- "url": null,
- "score": 0.9952012300491333
}
}
], - "filtered_detections": {
- "face_detections": [ ]
}
}
}
]
}
Get options for the resource.
verifier_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Verifier ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Count verifiers that satisfy the filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
description | string Records with descriptions similar to this parameter will be processed. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/verifiers" payload = { "description": "new verifier", "policies": { "verification_threshold": 0.5, "detect_policy": { "estimate_mask": 1 }, "extract_policy": { "extract_basic_attributes": 1 }, "storage_policy": { "attribute_policy": { "store_attribute": 1 }, "face_sample_policy": { "store_sample": 1, "ttl": 7 } } } } # create verifier requests.post(url, json=payload, headers=headers) url = f"{url}/count" # get verifiers count response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "verifiers_count": 4
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get verifier by ID.
verifier_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Verifier ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/verifiers" payload = { "description": "new verifier", "policies": { "verification_threshold": 0.5, "detect_policy": { "estimate_mask": 1 }, "extract_policy": { "extract_basic_attributes": 1 }, "storage_policy": { "attribute_policy": { "store_attribute": 1 }, "face_sample_policy": { "store_sample": 1, "ttl": 7 } } } } # create verifier response = requests.post(url, json=payload, headers=headers) verifierId = response.json()["verifier_id"] url = f"{url}/{verifierId}" # get verifier response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "verifier_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
- "description": "simple verifier",
- "policies": {
- "verification_threshold": 0.99,
- "detect_policy": {
- "multiface_policy": 0,
- "estimate_head_pose": 0,
- "estimate_emotions": 0,
- "estimate_mask": 0,
- "estimate_quality": 0,
- "estimate_gaze": 0,
- "estimate_eyes_attributes": 0,
- "estimate_mouth_attributes": 0,
- "detect_landmarks68": 0,
- "extract_exif": 0,
- "yaw_threshold": 180,
- "roll_threshold": 180,
- "pitch_threshold": 180,
- "mask_states": [
- 1
], - "estimate_liveness": {
- "estimate": 1,
- "quality_threshold": 0.7,
- "liveness_threshold": 0.7
}, - "liveness_states": [
- 1
], - "estimate_deepfake": {
- "estimate": 1,
- "real_threshold": 0.7,
- "mode": 2
}, - "deepfake_states": [
- 1
], - "estimate_face_occlusion": {
- "estimate": 0,
- "eye_threshold": 0.15,
- "forehead_threshold": 0.2,
- "hair_occlusion_threshold": 0.15,
- "lower_face_threshold": 0.2,
- "mouth_threshold": 0.15,
- "nose_threshold": 0.2,
- "occlusion_threshold": 0.07
}, - "face_occlusion_states": [
- "face"
], - "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 1
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.61,
- "max": 1
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.57,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": -8,
- "max": 8
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": -5,
- "max": 5
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0,
- "max": 0.5
}
}, - "glasses": {
- "estimate": 1,
- "threshold": [
- "no_glasses",
- "eyeglasses"
]
}, - "left_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "right_eye": {
- "estimate": 1,
- "threshold": [
- "open"
]
}, - "head_horizontal_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.45,
- "max": 0.55
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.5
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 0.75
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.6,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 90,
- "max": 1920
}
}, - "image_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "image_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1080
}
}, - "aspect_ratio": {
- "estimate": 1,
- "threshold": {
- "min": 0.74,
- "max": 0.8
}
}, - "face_width": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "face_height": {
- "estimate": 1,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1920
}
}, - "image_size": {
- "estimate": 1,
- "threshold": {
- "min": 5120,
- "max": 2097152
}
}, - "eyebrows_state": {
- "estimate": 1,
- "threshold": [
- "neutral"
]
}, - "smile_properties": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "headwear_type": {
- "estimate": 1,
- "threshold": [
- "none"
]
}, - "natural_light": {
- "estimate": 1,
- "threshold": 1
}, - "radial_distortion": {
- "estimate": 1,
- "threshold": 0
}, - "red_eyes": {
- "estimate": 1,
- "threshold": 0
}, - "face_color_type": {
- "estimate": 1,
- "threshold": [
- "color"
]
}, - "illumination_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_lightness": {
- "estimate": 1,
- "threshold": {
- "min": 0.2,
- "max": 1
}
}, - "background_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "shoulders_position": {
- "estimate": 1,
- "threshold": [
- "parallel"
]
}, - "face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "lower_face_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "forehead_occlusion": {
- "estimate": 1,
- "threshold": 0
}, - "nose_occlusion": {
- "estimate": 1,
- "threshold": 0
}
}
}
}, - "extract_policy": {
- "extract_basic_attributes": 1,
- "fd_score_threshold": 0.7
}, - "storage_policy": {
- "attribute_policy": {
- "store_attribute": 0
}, - "face_sample_policy": {
- "store_sample": 0,
- "ttl": 7
}
}
}, - "create_time": "2019-08-24T14:15:22Z",
- "last_update_time": "2019-08-24T14:15:22Z",
- "version": 111
}
Update the verifier. You can not update a part of verifier, so you should specify all the fields for your handler.
verifier_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Verifier ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Value: "application/json" Content type is |
description | string <= 128 characters Verifier user description. |
object |
{- "description": "strict verifier",
- "policies": {
- "verification_threshold": 0.9,
- "detect_policy": {
- "multiface_policy": 0,
- "estimate_head_pose": 0,
- "estimate_emotions": 0,
- "estimate_mask": 0,
- "estimate_quality": 0,
- "estimate_gaze": 0,
- "estimate_glasses": 0,
- "estimate_eyes_attributes": 0,
- "estimate_mouth_attributes": 0,
- "detect_landmarks68": 0,
- "extract_exif": 0,
- "yaw_threshold": 180,
- "roll_threshold": 180,
- "pitch_threshold": 180,
- "mask_states": [ ],
- "estimate_liveness": {
- "estimate": 0,
- "liveness_threshold": 0.5,
- "quality_threshold": 0.5
}, - "liveness_states": [ ],
- "estimate_deepfake": {
- "estimate": 0,
- "real_threshold": 0.5,
- "mode": 1
}, - "deepfake_states": [ ],
- "estimate_face_occlusion": {
- "estimate": 0,
- "occlusion_threshold": 0.07,
- "hair_occlusion_threshold": 0.15,
- "forehead_threshold": 0.2,
- "eye_threshold": 0.15,
- "nose_threshold": 0.2,
- "mouth_threshold": 0.15,
- "lower_face_threshold": 0.2
}, - "face_occlusion_states": [ ],
- "face_quality": {
- "estimate": 0,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 0,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "glasses": {
- "estimate": 0,
- "threshold": [
- "no_glasses",
- "eyeglasses"
]
}, - "left_eye": {
- "estimate": 0,
- "threshold": [
- "open"
]
}, - "right_eye": {
- "estimate": 0,
- "threshold": [
- "open"
]
}, - "head_horizontal_center": {
- "estimate": 0,
- "threshold": {
- "min": 0.45,
- "max": 0.55
}
}, - "head_vertical_center": {
- "estimate": 0,
- "threshold": {
- "min": 0.3,
- "max": 0.5
}
}, - "head_width": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 0.75
}
}, - "head_height": {
- "estimate": 0,
- "threshold": {
- "min": 0.6,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 0,
- "threshold": {
- "min": 91.1,
- "max": 92.2
}
}, - "image_width": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "image_height": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1080
}
}, - "aspect_ratio": {
- "estimate": 0,
- "threshold": {
- "min": 0.74,
- "max": 0.8
}
}, - "face_width": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 1920
}
}, - "face_height": {
- "estimate": 0,
- "threshold": {
- "min": 180,
- "max": 0
}
}, - "indent_left": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_right": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_upper": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_lower": {
- "estimate": 0,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "image_size": {
- "estimate": 0,
- "threshold": {
- "min": 5120,
- "max": 2097152
}
}, - "eyebrows_state": {
- "estimate": 0,
- "threshold": [
- "neutral"
]
}, - "headwear_type": {
- "estimate": 0,
- "threshold": [
- "none"
]
}, - "smile_properties": {
- "estimate": 0,
- "threshold": [
- "none"
]
}, - "face_color_type": {
- "estimate": 0,
- "threshold": [
- "color"
]
}, - "natural_light": {
- "estimate": 0,
- "threshold": 0
}, - "red_eyes": {
- "estimate": 0,
- "threshold": 0
}, - "radial_distortion": {
- "estimate": 0,
- "threshold": 0
}, - "illumination_uniformity": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_uniformity": {
- "estimate": 0,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "background_lightness": {
- "estimate": 0,
- "threshold": {
- "min": 0.2,
- "max": 1
}
}, - "shoulders_position": {
- "estimate": 0,
- "threshold": [
- "parallel"
]
}, - "face_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "lower_face_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "forehead_occlusion": {
- "estimate": 0,
- "threshold": 0
}, - "nose_occlusion": {
- "estimate": 0,
- "threshold": 0
}
}
}
}, - "extract_policy": {
- "extract_basic_attributes": 0,
- "fd_score_threshold": 0.7
}, - "storage_policy": {
- "attribute_policy": {
- "store_attribute": 0
}, - "face_sample_policy": {
- "store_sample": 0
}
}
}
}
{- "version": 111
}
Check if verifier with verifier_id
exists.
verifier_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Verifier ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/verifiers" payload = { "description": "new verifier", "policies": { "verification_threshold": 0.5, "detect_policy": { "estimate_mask": 1 }, "extract_policy": { "extract_basic_attributes": 1 }, "storage_policy": { "attribute_policy": { "store_attribute": 1 }, "face_sample_policy": { "store_sample": 1, "ttl": 7 } } } } # create verifier response = requests.post(url, json=payload, headers=headers) verifierId = response.json()["verifier_id"] url = f"{url}/{verifierId}" # check verifier response = requests.head(url, headers=headers) print(response.status_code)
Remove verifier by ID.
verifier_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Verifier ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="} url = f"{baseUri}/verifiers" payload = { "description": "new verifier", "policies": { "verification_threshold": 0.5, "detect_policy": { "estimate_mask": 1 }, "extract_policy": { "extract_basic_attributes": 1 }, "storage_policy": { "attribute_policy": { "store_attribute": 1 }, "face_sample_policy": { "store_sample": 1, "ttl": 7 } } } } # create verifier response = requests.post(url, json=payload, headers=headers) verifierId = response.json()["verifier_id"] url = f"{url}/{verifierId}" # delete verifier response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Get options for the resource.
verifier_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Verifier ID. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
sources | Array of strings Example: sources=cam1,cam2 Comma-separated list of sources. Each event from result will contain one of given sources. | ||||||||||||||||
stream_ids | Array of strings <uuid> (uuid) Example: stream_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of stream IDs. | ||||||||||||||||
matching_candidates_labels | Array of strings Example: matching_candidates_labels=matching_label_1,matching_label_2 Comma-separated list of matching candidates label. Each event from result will contain one or more given labels. | ||||||||||||||||
object_similarity__gte | number Example: object_similarity__gte=0.5 Object similarity lower included bound (boundary for top matching candidate). | ||||||||||||||||
object_similarity__lt | number Example: object_similarity__lt=0.5 Object similarity upper excluded bound (boundary for top matching candidate). | ||||||||||||||||
age__lt | integer Example: age__lt=50 Age upper excluded bound. | ||||||||||||||||
age__gte | integer Example: age__gte=50 Age lower included bound. | ||||||||||||||||
gender | integer Enum: 0 1 Example: gender=1 Gender. 1 - male, 0 - female. | ||||||||||||||||
ethnic_groups | Array of integers Items Enum: 1 2 3 4 Example: ethnic_groups=1,2 Comma-separated list of dominant ethnic group. Each event from result will contain one of the given ethnic groups.
| ||||||||||||||||
liveness | Array of integers Items Enum: 0 1 2 Example: liveness=1,2 Comma-separated list of dominant liveness. Each event from result will contain one of the given liveness.
| ||||||||||||||||
deepfake | Array of integers Items Enum: 0 1 Example: deepfake=0,1 Comma-separated list of dominant deepfakes. Each event from result will contain one of the given deepfake.
| ||||||||||||||||
tags | Array of strings (tag) >= 0 items [ items <= 36 characters ] Example: tags=tag_1,tag_2 Comma-separated list of tags. Each event from result will contain all of given tags. Each tag can be at most 36 characters. | ||||||||||||||||
user_data | string Example: user_data=user_data_text Find all objects with | ||||||||||||||||
object Example: geo_position=origin_longitude,36.616,origin_latitude,55.752 Geo position filter, i.e. geo bounding box specified by coordinates of its center (origin) and some delta. Each event from result will be covered by bbox specified. | |||||||||||||||||
cities | Array of strings Example: cities=Moscow,New York Comma-separated list of cities. Each event from result will contain one of given cities in "location" parameter. | ||||||||||||||||
areas | Array of strings Example: areas=CAD,Manhattan Comma-separated list of areas. Each event from result will contain one of given areas in "location" parameter. | ||||||||||||||||
districts | Array of strings Example: districts=Mitino,Midtown Comma-separated list of districts. Each event from result will contain one of given districts in "location" parameter. | ||||||||||||||||
streets | Array of strings Example: streets=Arbat,West 48th street Comma-separated list of streets. Each event from result will contain one of given streets in "location" parameter. | ||||||||||||||||
house_numbers | Array of strings Example: house_numbers=1,220 Comma-separated list of house numbers. Each event from result will contain one of given house numbers in "location" parameter. | ||||||||||||||||
handler_ids | Array of strings <uuid> (uuid) Example: handler_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of handler IDs. | ||||||||||||||||
masks | Array of integers Items Enum: 1 2 3 Example: masks=1,2,3 Comma-separated list of predominant masks. Each event from result will contain one of the given mask state.
| ||||||||||||||||
emotions | Array of integers Items Enum: 1 2 3 4 5 6 7 Example: emotions=1,2,3 Comma-separated list of predominant emotions. Each event from result will contain one of the given emotions.
| ||||||||||||||||
apparent_gender | Array of integers Items Enum: 0 1 2 Example: apparent_gender=1 Comma-separated list of apparent gender: 0 - female, 1 - male, 2 - undefined. Each event from result will contain one of the given states. | ||||||||||||||||
apparent_age__gte | integer [ 0 .. 100 ] Example: apparent_age__gte=50 Apparent age lower included bound. | ||||||||||||||||
apparent_age__lt | integer [ 0 .. 100 ] Example: apparent_age__lt=50 Apparent age upper excluded bound. | ||||||||||||||||
headwear_states | Array of integers Items Enum: 0 1 2 Example: headwear_states=1 Comma-separated list of headwear states: 0 - absent, 1 - present, 2 - undefined. Each event from result will contain one of the given states. | ||||||||||||||||
headwear_apparent_colors | Array of strings (headwear_color) Items Enum: "undefined" "black" "white" "other" Example: headwear_apparent_colors=white,undefined Comma-separated list of headwear apparent colors. Each event from result will contain one of the given states. | ||||||||||||||||
sleeve_lengths | Array of strings Items Enum: "short" "long" "undefined" Example: sleeve_lengths=short,undefined Comma-separated list of sleeve length states. Each event from result will contain one of the given states. | ||||||||||||||||
upper_clothing_colors | Array of strings (clothing_color) Items Enum: "undefined" "black" "blue" "green" "gray" "orange" "purple" "red" "white" "yellow" "pink" "brown" "beige" "khaki" "multicolored" Example: upper_clothing_colors=black,white Comma-separated list of upper clothing colors. Each event from result will contain at least one of the given clothing colors. | ||||||||||||||||
lower_garment_colors | Array of strings (clothing_color) Items Enum: "undefined" "black" "blue" "green" "gray" "orange" "purple" "red" "white" "yellow" "pink" "brown" "beige" "khaki" "multicolored" Example: lower_garment_colors=black,white Comma-separated list of lower garment colors. Each event from result will contain at least one of the given clothing colors. | ||||||||||||||||
lower_garment_types | Array of strings Items Enum: "undefined" "trousers" "shorts" "skirt" Example: lower_garment_types=trousers,undefined Comma-separated list of lower garment types. Each event from result will contain one of the given types. | ||||||||||||||||
shoes_apparent_colors | Array of strings (shoes_color) Items Enum: "undefined" "black" "white" "other" Example: shoes_apparent_colors=white,undefined Comma-separated list of shoes apparent colors. Each event from result will contain one of the given states. | ||||||||||||||||
backpack_states | Array of integers Items Enum: 0 1 2 Example: backpack_states=1 |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
from luna3.lunavl.httpclient import LunaHttpClient EXPECTED_EVENT_COUNT = 1 client = LunaHttpClient(origin='http://127.0.0.1:5000', api=6, login="luna@visionlabs.ru", password="luna") with client.wsConnect() as ws: for _ in range(EXPECTED_EVENT_COUNT): WS_RESP = ws.recv() print(WS_RESP)
{- "event": {
- "face_attributes": {
- "attribute_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "basic_attributes": {
- "age": 31,
- "gender": 1,
- "ethnicities": {
- "estimations": {
- "asian": 3.581344942826803e-10,
- "indian": 9.219499295942679e-12,
- "caucasian": 8.45913916691643e-9,
- "african_american": 1
}, - "predominant_ethnicity": "african_american"
}
}, - "score": 0.9883918166160583,
- "url": "/6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
- "samples": [
- "33bc3d2c-3c07-40af-8ee8-9c03e036b0ae"
]
}, - "body_attributes": {
- "score": 1,
- "samples": [
- "4d5766a3-2e39-4909-88c0-ac9f07c426eb"
]
}, - "source": "3rd Avenue",
- "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
- "tags": [
- "tag1",
- "tag2"
], - "event_id": "527fca61-d452-4dd2-ad97-63c5f95c02b1",
- "url": "/6/events/527fca61-d452-4dd2-ad97-63c5f95c02b1",
- "matches": [
- {
- "label": "good guys",
- "candidates": [
- {
- "face": {
- "face_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "account_id": "904e635f-3a47-4832-b4d6-d2d72ba78451",
- "user_data": "fox1991",
- "create_time": "2021-08-18T02:43:37.196724+03:00",
- "lists": [
- "429b0e78-4616-426a-b57f-02baa72d638d",
- "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
], - "event_id": "f9687459-986b-406d-9c1f-0d6289be5256"
}, - "similarity": 0.5
}
]
}, - {
- "label": "bad guys",
- "candidates": [
- {
- "event": {
- "event_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7",
- "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
- "user_data": "fox1991",
- "create_time": "2018-08-11T09:11:41.674Z",
- "handler_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7",
- "source": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7"
}, - "similarity": 0.3
}
]
}
], - "external_id": "external id",
- "user_data": "some event",
- "location": {
- "city": "Moscow",
- "area": "CAO",
- "district": "Mitino",
- "street": "Schepkina",
- "house_number": "1/2str3",
- "geo_position": {
- "longitude": 36.616,
- "latitude": 55.752
}
}, - "detections": [
- {
- "filename": "penelope.jpeg",
- "samples": {
- "face": {
- "sample_id": "33bc3d2c-3c07-40af-8ee8-9c03e036b0ae",
- "detection": {
- "attributes": {
- "liveness": {
- "prediction": "spoof",
- "estimations": {
- "quality": 1,
- "score": 0.600364089012146
}
}, - "deepfake": {
- "prediction": "fake",
- "score": 0.600364089012146
}, - "mouth_attributes": {
- "score": 0.3884400725,
- "occluded": 1.4e-8,
- "smile": 0.6115599275,
- "opened": 0.121500025
}, - "eyes_attributes": {
- "left_eye": {
- "iris_landmarks": [
- [
- 92,
- 92
], - [
- 92,
- 92
], - [
- 93,
- 93
], - [
- 93,
- 93
], - [
- 94,
- 94
], - [
- 95,
- 95
], - [
- 96,
- 96
], - [
- 98,
- 98
], - [
- 99,
- 99
], - [
- 100,
- 100
], - [
- 101,
- 101
], - [
- 102,
- 102
], - [
- 103,
- 103
], - [
- 104,
- 104
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 105,
- 105
], - [
- 104,
- 104
], - [
- 103,
- 103
], - [
- 102,
- 102
], - [
- 101,
- 101
], - [
- 100,
- 100
], - [
- 99,
- 99
], - [
- 98,
- 98
], - [
- 97,
- 97
], - [
- 96,
- 96
], - [
- 95,
- 95
], - [
- 94,
- 94
], - [
- 93,
- 93
], - [
- 93,
- 93
]
], - "state": "open"
}, - "right_eye": {
- "iris_landmarks": [
- [
- 152,
- 152
], - [
- 153,
- 153
], - [
- 153,
- 153
], - [
- 154,
- 154
], - [
- 154,
- 154
], - [
- 155,
- 155
], - [
- 157,
- 157
], - [
- 158,
- 158
], - [
- 159,
- 159
], - [
- 161,
- 161
], - [
- 162,
- 162
], - [
- 163,
- 163
], - [
- 164,
- 164
], - [
- 165,
- 165
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 166,
- 166
], - [
- 165,
- 165
], - [
- 164,
- 164
], - [
- 163,
- 163
], - [
- 162,
- 162
], - [
- 161,
- 161
], - [
- 159,
- 159
], - [
- 158,
- 158
], - [
- 158,
- 158
], - [
- 157,
- 157
], - [
- 156,
- 156
], - [
- 154,
- 154
], - [
- 154,
- 154
], - [
- 153,
- 153
]
], - "state": "open"
}
}, - "emotions": {
- "predominant_emotion": "neutral",
- "estimations": {
- "anger": 0.00894705578684807,
- "disgust": 0.00000965219624049496,
- "fear": 0.00121302821207792,
- "happiness": 0.00129503419157118,
- "neutral": 0.986027479171753,
- "sadness": 0.00187553185969591,
- "surprise": 0.000632198702078313
}
}, - "mask": {
- "predominant_mask": "occluded",
- "estimations": {
- "medical_mask": 0.020060448,
- "missing": 0.3235525191,
- "occluded": 0.6563870311
}, - "face_occlusion": {
- "predominant_occlusion": "correct",
- "estimations": {
- "full": 0.019,
- "clear": 0.02,
- "correct": 0.6108324766,
- "partially": 0.31,
- "mouth": 0.0209,
- "chin": 0.019097
}
}
}, - "head_pose": {
- "pitch": 12.7464532852,
- "roll": -2.9892115593,
- "yaw": 17.7173442841
}, - "gaze": {
- "yaw": -5.9912848473,
- "pitch": -10.2646684647
}
}, - "quality": {
- "blurriness": 0.9769582748000001,
- "dark": 0.9542820454000001,
- "illumination": 0.8248310089,
- "specularity": 0.8472354412,
- "light": 0.8179533482
}, - "rect": {
- "x": 255,
- "y": 101,
- "width": 137,
- "height": 183
}, - "landmarks5": [
- [
- 43,
- 66
], - [
- 106,
- 63
], - [
- 89,
- 105
], - [
- 54,
- 133
], - [
- 116,
- 128
]
], - "landmarks68": [
- [
- 8,
- 8
], - [
- 14,
- 14
], - [
- 28,
- 28
], - [
- 48,
- 48
], - [
- 72,
- 72
], - [
- 102,
- 102
], - [
- 134,
- 134
], - [
- 168,
- 168
], - [
- 213,
- 213
], - [
- 262,
- 262
], - [
- 306,
- 306
], - [
- 345,
- 345
], - [
- 376,
- 376
], - [
- 392,
- 392
], - [
- 397,
- 397
], - [
- 399,
- 399
], - [
- 394,
- 394
], - [
- 2,
- 2
], - [
- 22,
- 22
], - [
- 50,
- 50
], - [
- 79,
- 79
], - [
- 106,
- 106
], - [
- 165,
- 165
], - [
- 199,
- 199
], - [
- 236,
- 236
], - [
- 278,
- 278
], - [
- 317,
- 317
], - [
- 137,
- 137
], - [
- 136,
- 136
], - [
- 136,
- 136
], - [
- 136,
- 136
], - [
- 119,
- 119
], - [
- 135,
- 135
], - [
- 154,
- 154
], - [
- 174,
- 174
], - [
- 193,
- 193
], - [
- 40,
- 40
], - [
- 57,
- 57
], - [
- 83,
- 83
], - [
- 108,
- 108
], - [
- 84,
- 84
], - [
- 58,
- 58
], - [
- 203,
- 203
], - [
- 222,
- 222
], - [
- 249,
- 249
], - [
- 277,
- 277
], - [
- 258,
- 258
], - [
- 229,
- 229
], - [
- 119,
- 119
], - [
- 130,
- 130
], - [
- 149,
- 149
], - [
- 167,
- 167
], - [
- 185,
- 185
], - [
- 222,
- 222
], - [
- 259,
- 259
], - [
- 232,
- 232
], - [
- 200,
- 200
], - [
- 177,
- 177
], - [
- 155,
- 155
], - [
- 134,
- 134
], - [
- 127,
- 127
], - [
- 152,
- 152
], - [
- 170,
- 170
], - [
- 190,
- 190
], - [
- 250,
- 250
], - [
- 193,
- 193
], - [
- 172,
- 172
], - [
- 152,
- 152
]
], - "face_quality": {
- "status": 1,
- "checks": [
- {
- "name": "image_format",
- "object_value": "JPEG",
- "threshold_value": [
- "JPEG",
- "JPEG2000",
- "PNG"
], - "result": 1
}, - {
- "name": "illumination_quality",
- "object_value": 0.6005162000656128,
- "threshold_value": {
- "min": 0.3,
- "max": 1
}, - "result": 1
}, - {
- "name": "specularity_quality",
- "object_value": 0.7662366628646851,
- "threshold_value": {
- "min": 0.3,
- "max": 1
}, - "result": 1
}, - {
- "name": "blurriness_quality",
- "object_value": 0.9429352283477783,
- "threshold_value": {
- "min": 0.61,
- "max": 1
}, - "result": 1
}, - {
- "name": "dark_quality",
- "object_value": 0.9020983576774597,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "light_quality",
- "object_value": 0.7881984114646912,
- "threshold_value": {
- "min": 0.57,
- "max": 1
}, - "result": 1
}, - {
- "name": "head_yaw",
- "object_value": 2.818983316421509,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_pitch",
- "object_value": 3.816443920135498,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "head_roll",
- "object_value": 5.434040069580078,
- "threshold_value": {
- "min": -8,
- "max": 8
}, - "result": 1
}, - {
- "name": "gaze_yaw",
- "object_value": -3.773012399673462,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "gaze_pitch",
- "object_value": 0.7140519022941589,
- "threshold_value": {
- "min": -5,
- "max": 5
}, - "result": 1
}, - {
- "name": "mouth_smiling",
- "object_value": 0.000290759839117527,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_occluded",
- "object_value": 0.00009619363845558837,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "mouth_open",
- "object_value": 0.6226108074188232,
- "threshold_value": {
- "min": 0,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "glasses",
- "object_value": "no_glasses",
- "threshold_value": [
- "no_glasses",
- "eyeglasses"
], - "result": 1
}, - {
- "name": "left_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "right_eye",
- "object_value": "open",
- "threshold_value": [
- "open"
], - "result": 1
}, - {
- "name": "head_horizontal_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.45,
- "max": 0.55
}, - "result": 1
}, - {
- "name": "head_vertical_center",
- "object_value": 0.51,
- "threshold_value": {
- "min": 0.3,
- "max": 0.5
}, - "result": 1
}, - {
- "name": "head_width",
- "object_value": 0.61,
- "threshold_value": {
- "min": 0.5,
- "max": 0.75
}, - "result": 1
}, - {
- "name": "head_height",
- "object_value": 0.71,
- "threshold_value": {
- "min": 0.6,
- "max": 0.9
}, - "result": 1
}, - {
- "name": "eye_distance",
- "object_value": 110,
- "threshold_value": {
- "min": 90,
- "max": null
}, - "result": 1
}, - {
- "name": "image_width",
- "object_value": 1000,
- "threshold_value": {
- "min": 200,
- "max": 1100
}, - "result": 1
}, - {
- "name": "image_height",
- "object_value": 2000,
- "threshold_value": {
- "min": 200,
- "max": 1100
}, - "result": 1
}, - {
- "name": "aspect_ratio",
- "object_value": 0.5,
- "threshold_value": {
- "min": 0.1,
- "max": 1
}, - "result": 1
}, - {
- "name": "face_width",
- "object_value": 500,
- "threshold_value": {
- "min": 400,
- "max": 600
}, - "result": 1
}, - {
- "name": "face_height",
- "object_value": 500,
- "threshold_value": {
- "min": 400,
- "max": 600
}, - "result": 1
}, - {
- "name": "indent_left",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_right",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_upper",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "indent_lower",
- "object_value": 100,
- "threshold_value": {
- "min": 10,
- "max": 500
}, - "result": 1
}, - {
- "name": "image_size",
- "object_value": 100500,
- "threshold_value": {
- "min": 10,
- "max": 100600
}, - "result": 1
}, - {
- "name": "eyebrows_state",
- "object_value": "neutral",
- "threshold_value": [
- "neutral"
], - "result": 1
}, - {
- "name": "smile_properties",
- "object_value": "smile_lips",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "headwear_type",
- "object_value": "hat",
- "threshold_value": [
- "none"
], - "result": 0
}, - {
- "name": "natural_light",
- "object_value": 1,
- "threshold_value": 1,
- "result": 1
}, - {
- "name": "radial_distortion",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "red_eyes",
- "object_value": 0,
- "threshold_value": 0,
- "result": 1
}, - {
- "name": "face_color_type",
- "object_value": "color",
- "threshold_value": [
- "color"
], - "result": 1
}, - {
- "name": "illumination_uniformity",
- "object_value": 0.7305162000656128,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "dynamic_range",
- "object_value": 0.6605162000656128,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "background_uniformity",
- "object_value": 0.8874394297599792,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}, - {
- "name": "background_lightness",
- "object_value": 0.5780888795852661,
- "threshold_value": {
- "min": 0.5,
- "max": 1
}, - "result": 1
}
]
}
}, - "url": "/6/samples/faces/33bc3d2c-3c07-40af-8ee8-9c03e036b0ae"
}, - "body": {
- "sample_id": "4d5766a3-2e39-4909-88c0-ac9f07c426eb",
- "detection": {
- "rect": {
- "x": 52,
- "y": 65,
- "width": 748,
- "height": 895
}, - "attributes": {
- "basic_attributes": {
- "apparent_age": 25,
- "apparent_gender": 0
}, - "upper_body": {
- "headwear": {
- "state": 0,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "short"
}, - "upper_clothing": {
- "colors": [
- "white",
- "black"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "trousers",
- "colors": [
- "white",
- "black"
]
}, - "shoes": {
- "apparent_color": "black"
}
}, - "accessories": {
- "backpack": {
- "state": 0
}
}
}
}, - "url": "/6/samples/bodies/4d5766a3-2e39-4909-88c0-ac9f07c426eb"
}
}, - "detect_time": "2021-06-18T02:44:58.653485+03:00",
- "detect_ts": 123.456,
- "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
}
], - "meta": {
- "foo": "bar"
}, - "aggregate_estimations": {
- "face": {
- "attributes": {
- "liveness": {
- "prediction": "spoof",
- "estimations": {
- "quality": 1,
- "score": 0.600364089012146
}
}, - "deepfake": {
- "prediction": "fake",
- "score": 0.600364089012146
}, - "mask": {
- "estimations": {
- "medical_mask": 0.020060448,
- "missing": 0.3235525191,
- "occluded": 0.6563870311
}, - "predominant_mask": "occluded",
- "face_occlusion": {
- "predominant_occlusion": "correct",
- "estimations": {
- "full": 0.019,
- "clear": 0.02,
- "correct": 0.6108324766,
- "partially": 0.31,
- "mouth": 0.0209,
- "chin": 0.019097
}
}
}, - "emotions": {
- "estimations": {
- "anger": 0.00894705578684807,
- "disgust": 0.00000965219624049496,
- "fear": 0.00121302821207792,
- "happiness": 0.00129503419157118,
- "neutral": 0.986027479171753,
- "sadness": 0.00187553185969591,
- "surprise": 0.000632198702078313
}, - "predominant_emotion": "neutral"
}
}
}, - "body": {
- "attributes": {
- "basic_attributes": {
- "apparent_age": 25,
- "apparent_gender": 0
}, - "upper_body": {
- "headwear": {
- "state": 0,
- "apparent_color": "undefined"
}, - "sleeve": {
- "length": "short"
}, - "upper_clothing": {
- "colors": [
- "white",
- "black"
]
}
}, - "lower_body": {
- "lower_garment": {
- "type": "trousers",
- "colors": [
- "white",
- "black"
]
}, - "shoes": {
- "apparent_color": "black"
}
}, - "accessories": {
- "backpack": {
- "state": 0
}
}
}
}
}, - "track_id": "useful_track_id_number_1",
- "face": {
- "external_id": "external id",
- "face_id": "a9629ef8-148f-4630-8584-dcf52caf8374",
- "url": "/6/faces/a9629ef8-148f-4630-8584-dcf52caf8374",
- "lists": [
- "429b0e78-4616-426a-b57f-02baa72d638d",
- "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
], - "user_data": "top face",
- "avatar": "/6/samples/33bc3d2c-3c07-40af-8ee8-9c03e036b0ae",
- "event_id": "527fca61-d452-4dd2-ad97-63c5f95c02b1"
}
}, - "handler_id": "88c5dd7e-693b-4386-92bc-0c31a150a7d0",
- "event-create-time": "2021-06-18T02:44:58.653485+03:00",
- "event-end-time": "2021-06-18T02:44:58.653485+03:00",
- "Luna-Request-id": "1623984298,375c6d96-09c7-4db3-91cc-f13e66288aa9"
}
event_type | string <list of strings (some_event_type_1, some_event_type_1)> Example: event_type=some_event_type_1,some_event_type_1 Comma-separated list of general event types to subscribe. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sources | Array of strings Example: sources=cam1,cam2 Comma-separated list of sources. Each event from result will contain one of given sources. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stream_ids | Array of strings <uuid> (uuid) Example: stream_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of stream IDs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
object Example: geo_position=origin_longitude,36.616,origin_latitude,55.752 Geo position filter, i.e. geo bounding box specified by coordinates of its center (origin) and some delta. Each event from result will be covered by bbox specified. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cities | Array of strings Example: cities=Moscow,New York Comma-separated list of cities. Each event from result will contain one of given cities in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
areas | Array of strings Example: areas=CAD,Manhattan Comma-separated list of areas. Each event from result will contain one of given areas in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
districts | Array of strings Example: districts=Mitino,Midtown Comma-separated list of districts. Each event from result will contain one of given districts in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
streets | Array of strings Example: streets=Arbat,West 48th street Comma-separated list of streets. Each event from result will contain one of given streets in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
house_numbers | Array of strings Example: house_numbers=1,220 Comma-separated list of house numbers. Each event from result will contain one of given house numbers in "location" parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
account_id | string Example: account_id=8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a General event account to subscribe. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* (event.path.to.field__operator:type) | string Example: event.field_1__gt:numeric=36.6&event.field_2.field_3__in=value,none&event.field_4:integer=5 User-defined general event filters. Parameter name pattern: Path to field is an event json field path. To navigate through nested objects the dot (.) is used. Field comparison operator is optional one of Field data type is optional one of Allowed usage of filters is:
|
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
from luna3.lunavl.httpclient import LunaHttpClient client = LunaHttpClient(origin='http://127.0.0.1:5000', api=6, login="luna@visionlabs.ru", password="luna") with client.generalConnect() as ws: for _ in range(3): WS_RESP = ws.recv() print(WS_RESP)
{- "event": { },
- "event_type": "string",
- "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "event-create-time": "2019-08-24T14:15:22Z",
- "event-end-time": "2019-08-24T14:15:22Z"
}
Set login cookie.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 11065,
- "desc": "Authorization failed",
- "detail": "Bad format basic authorization header",
}
Clear login cookie.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Predict liveness probability in input images.
The response contains the probability that there is a real person in the image, and it is not a presentation attack.
"meta" and "x_meta" sections of the request are used for backward compatibility and are deprecated now.
The incoming images should correspond the requirements of the utilized Liveness version. See "Administrator’s manual" for details.
Liveness estimation is not supported for samples (warped images).
aggregate | integer Default: 0 Enum: 1 0 Example: aggregate=1 Whether to aggregate liveness estimations. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Content-Type | string Enum: "image/jpeg" "image/png" "image/bmp" "image/x-portable-pixmap" "image/tiff" "multipart/form-data" "application/json" "image/x-jpeg-base64" "image/x-png-base64" "image/x-bmp-base64" "image/x-tiff-base64" "image/x-portable-pixmap-base64" |
object (LivenessMeta) Deprecated Device information. This information can significantly decrease the overall error rate. The "meta" object is not mandatory. If you are not sure about any of the parameters, set "UNKNOWN" value or don't pass meta.
| |
x_meta | object Deprecated The JSON string with any additional information. |
required | Array of image_binary_for_multipart (string) or image_base64_for_multipart (string) (image_list_for_multipart) non-empty |
{- "images": [
- {
- "filename": "succeeded_image.jpg",
- "status": 1,
- "liveness": {
- "prediction": 1,
- "estimations": {
- "probability": 0.93,
- "quality": 1
}
}, - "error": {
- "desc": "Success",
- "detail": "Success",
- "error_code": 0,
}
}, - {
- "filename": "succeeded_image_2.jpg",
- "status": 1,
- "liveness": {
- "prediction": 1,
- "estimations": {
- "probability": 0.85,
- "quality": 1
}
}, - "error": {
- "desc": "Success",
- "detail": "Success",
- "error_code": 0,
}
}, - {
- "filename": "failed_image.jpg",
- "status": 0,
- "liveness": null,
- "error": {
- "desc": "Failed to decode image data",
- "detail": "File decoding error",
- "error_code": 32010,
}
}
], - "aggregate_estimations": {
- "liveness": {
- "prediction": 1,
- "estimations": {
- "probability": 0.89,
- "quality": 1
}
}
}
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get service OpenApi documentation. If Accept request header is of type application/x-yaml
,
returns documentation in yaml
format or returns html
documentation, if Accept is text/html
.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Accept required | string (accept_docs_handler) Enum: "application/x-yaml" "text/html" Acceptable type of receiving data. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get sphinx documentation - Development Manual. After the request you will be redirected to the page /docs/dev/index.html
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get service configuration. Passwords and tokens will be hidden in the response.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Accept | string Enum: "application/json" "text/plain" Acceptable type of receiving data. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/config" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "INFLUX_MONITORING": {
- "SEND_DATA_FOR_MONITORING": 0,
- "VERSION": 2,
- "ORGANIZATION": "ORGANIZATION_NAME",
- "TOKEN": "********",
- "BUCKET": "luna_monitoring",
- "HOST": "127.0.0.1",
- "PORT": 8086,
- "USE_SSL": 0,
- "FLUSHING_PERIOD": 1
}
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get information about platform features:
license
)estimations
)components
)Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=" } url = f"{baseUri}/features" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "license": true,
- "estimations": {
- "people_counter": true,
- "face_quality": true,
- "body_attributes": true,
- "liveness": true,
- "deepfake": true
}, - "components": {
- "events": true,
- "tasks": true,
- "sender": true,
- "image_store": true,
- "handlers": true,
- "video_analytics": true,
- "lambdas": true
}
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get list of service plugins:
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=" } url = f"{baseUri}/plugins" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "plugins": [
- {
- "name": "string",
- "running": 0
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create a new lambda.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type required | string Value: "multipart/form-data" The request content type header. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
archive required | string <binary> Archive file with zip extension. Content-Type must be "application/zip". |
required | object Lambda credentials. Content-Type must be "application/json". |
object Parameters for lambda. Content-Type must be "application/json". | |
object (deploy_parameters) Deploy parameters for lambda. Content-Type must be "application/json". |
# This example is written using requests library from time import sleep import json from uuid import uuid4 import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } lambdaName = str(uuid4()) url = f"{baseUri}/lambdas/" namespace = "default" with open("lambda.zip", "rb") as archive: files = { "archive": ("lambda.zip", archive.read(), "application/zip"), "credentials": ( "credentials", json.dumps( {"lambda_name": lambdaName, "description": "test description"} ), "application/json"), "parameters": ( "parameters", json.dumps( {"lambda_type": "standalone"} ), "application/json"), } response = requests.post(url, headers=headers, files=files) print(response.status_code) print(response.json())
{- "lambda_id": "string"
}
Get lambdas according to filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. |
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. |
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
lambda_type | string Enum: "standalone" "handlers" "tasks" Lambda type. |
namespace | Array of strings (namespace) Example: namespace=default,no-default-namespace Comma-separated list of lambda namespaces.
Each namespace must match the pattern |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library from time import sleep from datetime import datetime, timedelta from uuid import uuid4 import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } accountId = "00000000-0000-4000-a000-000000000156" lambdaId = str(uuid4()) lambdaName = str(uuid4()) timeDelta = timedelta(days=1) namespace = "default" params = { "account_id": accountId, "create_time__lt": datetime.utcnow().isoformat("T") + "Z", "create_time__gte": (datetime.utcnow() - timeDelta).isoformat("T") + "Z", "page": 1, "page_size": 100, "lambda_type": "standalone", "namespace": namespace } url = f"{baseUri}/lambdas/" response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "lambdas": [
- {
- "account_id": "string",
- "lambda_id": "string",
- "lambda_name": "first-lambda",
- "description": "very useful lambda",
- "version": 1,
- "info": {
- "status": "running",
- "pod_statuses": {
- "0": "running",
- "1": "waiting"
}
}, - "lambda_type": "standalone",
- "create_time": "2019-08-24T14:15:22Z",
- "last_update_time": "2018-08-11T09:11:41.674Z",
- "additional_user_docker_commands": [ ],
- "base_image": {
- "name": "string",
- "tag": "string"
}, - "workers": 1,
- "archive_ttl": 7,
- "deploy_parameters": {
- "gpu_enabled": 0,
- "pod_count": 2,
- "resources": {
- "cpu_limit": 1000,
- "ram_limit": 1,
- "cpu_request": 1000,
- "ram_request": 1
}, - "namespace": "string",
- "selector": {
- "app": "lambda-name"
}
}
}
]
}
Validate lambda.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type required | string Value: "multipart/form-data" The request content type header. |
archive required | string <binary> Archive file with zip extension. Content-Type must be "application/zip". |
required | object Parameters for lambda. |
# This example is written using requests library from time import sleep import json import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } url = f"{baseUri}/lambdas/validator" with open("lambda.zip", "rb") as archive: files = { "archive": ("lambda.zip", archive.read(), "application/zip"), "parameters": ( "parameters", json.dumps({"lambda_type": "standalone"}), "application/json", ) } response = requests.post(url, headers=headers, files=files) print(response.status_code)
{- "errors": [
- "validation_error_one",
- "validation_error_two"
]
}
Update lambda. You cannot update a part of the lambda, so you should specify all the fields for your lambda.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type required | string Value: "multipart/form-data" The request content type header. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
archive required | string <binary> Archive file with zip extension. Content-Type must be "application/zip". |
required | object Lambda credentials. Content-Type must be "application/json". |
object Parameters for lambda. Content-Type must be "application/json". | |
object (deploy_parameters) Deploy parameters for lambda. Content-Type must be "application/json". |
# This example is written using requests library from time import sleep import json from uuid import uuid4 import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } # Create lambda def wait4start(lambdaId: str) -> None: """ Wait for lambda start Args: lambdaId: lambda id """ for _ in range(150): reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json() if reply["status"] == "running": break if reply["status"] == "terminated": raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}") sleep(1) else: raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}") url = f"{baseUri}/lambdas/" with open("lambda.zip", "rb") as archive: files = { "archive": ("lambda.zip", archive.read(), "application/zip"), "credentials": ( "credentials", json.dumps( {"lambda_name": str(uuid4()), "description": "new lambda description"} ), "application/json"), "parameters": ( "parameters", json.dumps( {"lambda_type": "standalone"} ), "application/json"), } response = requests.post(url, headers=headers, files=files) lambdaId = response.json()["lambda_id"] wait4start(lambdaId) # Put lambda files.update( { "credentials": ( "credentials", json.dumps( {"lambda_name": str(uuid4()), "description": "new lambda description"} ), "application/json") } ) response = requests.put(url + lambdaId, headers=headers, files=files) print(response.status_code) print(response.json())
{- "version": 0
}
Patch lambda.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" The request content type header. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
lambda_name | string (lambda_name) Lambda name. Each user can create only lambdas with unique names. |
description | string <= 256 characters Lambda description. |
{- "lambda_name": "first-lambda",
- "description": "very useful lambda"
}
{- "error_code": 11066,
- "desc": "Bad/incomplete input data",
- "detail": "Luna-Account-Id header not found",
}
Get lambda by ID.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library from time import sleep import json import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } lambdaId = "64e61920-f5ca-4caf-8f2e-d0217e2e6c0f" url = f"{baseUri}/lambdas/{lambdaId}" params = { "account_id": "00000000-0000-4000-a000-000000000156", } response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "account_id": "string",
- "lambda_id": "string",
- "lambda_name": "first-lambda",
- "description": "very useful lambda",
- "version": 1,
- "info": {
- "status": "running",
- "pod_statuses": {
- "0": "running",
- "1": "waiting"
}
}, - "lambda_type": "standalone",
- "create_time": "2019-08-24T14:15:22Z",
- "last_update_time": "2018-08-11T09:11:41.674Z",
- "additional_user_docker_commands": [ ],
- "base_image": {
- "name": "string",
- "tag": "string"
}, - "workers": 1,
- "archive_ttl": 7,
- "deploy_parameters": {
- "gpu_enabled": 0,
- "pod_count": 2,
- "resources": {
- "cpu_limit": 1000,
- "ram_limit": 1,
- "cpu_request": 1000,
- "ram_request": 1
}, - "namespace": "string",
- "selector": {
- "app": "lambda-name"
}
}
}
Check existence of the lambda by ID.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library from time import sleep import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } lambdaId = "64e61920-f5ca-4caf-8f2e-d0217e2e6c0f" url = f"{baseUri}/lambdas/{lambdaId}" response = requests.head(url, headers=headers) print(response.status_code)
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Remove lambda by ID.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library from time import sleep import requests import json from uuid import uuid4 baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } # Create lambda def wait4start(lambdaId: str) -> None: """ Wait for lambda start Args: lambdaId: lambda id """ for _ in range(150): reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json() if reply["status"] == "running": break if reply["status"] == "terminated": raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}") sleep(1) else: raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}") lambdaName = str(uuid4()) url = f"{baseUri}/lambdas/" with open("lambda.zip", "rb") as archive: files = { "archive": ("lambda.zip", archive.read(), "application/zip"), "credentials": ( "credentials", json.dumps( {"lambda_name": lambdaName, "description": "lambda description"} ), "application/json"), "parameters": ( "parameters", json.dumps( {"lambda_type": "standalone"} ), "application/json"), } response = requests.post(url, headers=headers, files=files) lambdaId = response.json()["lambda_id"] wait4start(lambdaId) # Delete lambda url = f"{baseUri}/lambdas/{lambdaId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Update lambda using latest base image.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the plugin. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library from time import sleep import json from uuid import uuid4 import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } # Create lambda def wait4start(lambdaId: str) -> None: """ Wait for lambda start Args: lambdaId: lambda id """ for _ in range(150): reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json() if reply["status"] == "running": break if reply["status"] == "terminated": raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}") sleep(1) else: raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}") lambdaName = str(uuid4()) url = f"{baseUri}/lambdas/" with open("lambda.zip", "rb") as archive: files = { "archive": ("lambda.zip", archive.read(), "application/zip"), "credentials": ( "credentials", json.dumps( {"lambda_name": lambdaName, "description": "lambda description"} ), "application/json"), "parameters": ( "parameters", json.dumps( {"lambda_type": "standalone"} ), "application/json"), } response = requests.post(url, headers=headers, files=files) lambdaId = response.json()["lambda_id"] wait4start(lambdaId) # Update lambda url = f"{baseUri}/lambdas/{lambdaId}/update" response = requests.post(url, headers=headers) print(response.status_code) print(response.json())
{- "version": 0
}
Get lambda image creation status by lambda ID.
If lambda image creation is in progress, lambda status will be waiting
.
After lambda image creation will end, the lambda image creation job will be removed and status will be not_found
.
For more information about lambda and lambda images statuses see development manual.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library from time import sleep import json from uuid import uuid4 import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } # Create lambda def wait4start(lambdaId: str) -> None: """ Wait for lambda start Args: lambdaId: lambda id """ for _ in range(150): reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json() if reply["status"] == "running": break if reply["status"] == "terminated": raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}") sleep(1) else: raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}") lambdaName = str(uuid4()) url = f"{baseUri}/lambdas/" with open("lambda.zip", "rb") as archive: files = { "archive": ("lambda.zip", archive.read(), "application/zip"), "credentials": ( "credentials", json.dumps({"lambda_name": lambdaName, "description": "lambda description"}), "application/json", ), "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"), } response = requests.post(url, headers=headers, files=files) lambdaId = response.json()["lambda_id"] wait4start(lambdaId) # Get lambda image creation status url = f"{baseUri}/lambdas/{lambdaId}/image/status" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "status": "not_found"
}
Get lambda image creation logs by lambda ID.
During the creation of the lambda image, it is possible to get logs to monitor the progress.
For more information about lambda and lambda images logs see development manual.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
tail_lines | integer [ 0 .. 4294967296 ] Number of strings what will be return. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library from time import sleep import json from uuid import uuid4 import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } # Create lambda def wait4start(lambdaId: str) -> None: """ Wait for lambda start Args: lambdaId: lambda id """ for _ in range(150): reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json() if reply["status"] == "running": break if reply["status"] == "terminated": raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}") sleep(1) else: raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}") lambdaName = str(uuid4()) url = f"{baseUri}/lambdas/" with open("lambda.zip", "rb") as archive: files = { "archive": ("lambda.zip", archive.read(), "application/zip"), "credentials": ( "credentials", json.dumps({"lambda_name": lambdaName, "description": "lambda description"}), "application/json", ), "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"), } response = requests.post(url, headers=headers, files=files) lambdaId = response.json()["lambda_id"] wait4start(lambdaId) # Get lambda image creation logs url = f"{baseUri}/lambdas/{lambdaId}/image/logs" params = {"tail_lines": 1} response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "logs": [
- "string"
]
}
Get lambda status by ID.
If lambda image creation is in progress, lambda status will be waiting
.
For more information about lambda and lambda images statuses see development manual.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library from time import sleep import json from uuid import uuid4 import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } # Create lambda def wait4start(lambdaId: str) -> None: """ Wait for lambda start Args: lambdaId: lambda id """ for _ in range(150): reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json() if reply["status"] == "running": break if reply["status"] == "terminated": raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}") sleep(1) else: raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}") lambdaName = str(uuid4()) url = f"{baseUri}/lambdas/" with open("lambda.zip", "rb") as archive: files = { "archive": ("lambda.zip", archive.read(), "application/zip"), "credentials": ( "credentials", json.dumps({"lambda_name": lambdaName, "description": "lambda description"}), "application/json", ), "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"), } response = requests.post(url, headers=headers, files=files) lambdaId = response.json()["lambda_id"] wait4start(lambdaId) # Get lambda image creation status url = f"{baseUri}/lambdas/{lambdaId}/status" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "status": "running",
- "pod_statuses": {
- "0": "running",
- "1": "waiting"
}
}
Get lambda logs by ID.
After lambda creation has been executed, there is possibility to get lambda logs.
For more information about lambda and lambda images logs see development manual.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
tail_lines | integer [ 0 .. 4294967296 ] Number of strings what will be return. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library from time import sleep import json from uuid import uuid4 import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } # Create lambda def wait4start(lambdaId: str) -> None: """ Wait for lambda start Args: lambdaId: lambda id """ for _ in range(150): reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json() if reply["status"] == "running": break if reply["status"] == "terminated": raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}") sleep(1) else: raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}") lambdaName = str(uuid4()) url = f"{baseUri}/lambdas/" with open("lambda.zip", "rb") as archive: files = { "archive": ("lambda.zip", archive.read(), "application/zip"), "credentials": ( "credentials", json.dumps({"lambda_name": lambdaName, "description": "lambda description"}), "application/json", ), "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"), } response = requests.post(url, headers=headers, files=files) lambdaId = response.json()["lambda_id"] wait4start(lambdaId) # Get lambda image creation logs url = f"{baseUri}/lambdas/{lambdaId}/logs" params = {"tail_lines": 1} response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "logs": { }
}
Get lambda OpenApi documentation. If Accept request header is of type application/x-yaml
,
returns documentation in yaml
format or returns html
documentation, if Accept-Type is text/html
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Accept required | string (accept_docs_handler) Enum: "application/x-yaml" "text/html" Acceptable type of receiving data. |
{- "error_code": 42001,
- "desc": "Object not found",
- "detail": "Lambda with id 'e63e2a1f-f505-441c-8e11-b2dcd0385329' not found",
}
Proxy POST request to lambda.
Request and response headers, query parameters and body description must be provided by lambda documentation.
Described headers will be processed and received independently of lambda behavior.
In case of bearer
authorization, the token must include view
permissions for lambdas
to process request.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
* (any_parameter) | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Any additional path parameter will be use as path parameter to lambda |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
# This example is written using requests library from time import sleep import json from uuid import uuid4 import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } # Create lambda def wait4start(lambdaId: str) -> None: """ Wait for lambda start Args: lambdaId: lambda id """ for _ in range(150): reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json() if reply["status"] == "running": break if reply["status"] == "terminated": raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}") sleep(1) else: raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}") lambdaName = str(uuid4()) url = f"{baseUri}/lambdas/" with open("lambda.zip", "rb") as archive: files = { "archive": ("lambda.zip", archive.read(), "application/zip"), "credentials": ( "credentials", json.dumps({"lambda_name": lambdaName, "description": "lambda description"}), "application/json", ), "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"), } response = requests.post(url, headers=headers, files=files) lambdaId = response.json()["lambda_id"] wait4start(lambdaId) # Post proxy request to lambda path = "main" url = f"{baseUri}/lambdas/{lambdaId}/proxy/{path}" response = requests.post(url, headers=headers) print(response.status_code) print(response.json())
{- "error_code": 11062,
- "desc": "Forbidden",
- "detail": "Specified token corrupted",
}
Proxy OPTIONS request to lambda.
The response to options contains all the possible methods that can be proxyed to a lambda, but does not say which of them are implemented and which are not.
lambda_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the lambda. |
* (any_parameter) | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 Any additional path parameter will be use as path parameter to lambda |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library from time import sleep import json from uuid import uuid4 import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h", } # Create lambda lambdaName = str(uuid4()) url = f"{baseUri}/lambdas/" with open("lambda.zip", "rb") as archive: files = { "archive": ("lambda.zip", archive.read(), "application/zip"), "credentials": ( "credentials", json.dumps({"lambda_name": lambdaName, "description": "lambda description"}), "application/json", ), "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"), } response = requests.post(url, headers=headers, files=files) lambdaId = response.json()["lambda_id"] wait4start(lambdaId) # Put proxy request to lambda path = "main" url = f"{baseUri}/lambdas/{lambdaId}/proxy/{path}" response = requests.options(url, headers=headers) print(response.status_code) print(response.headers)
{- "error_code": 11062,
- "desc": "Forbidden",
- "detail": "Specified token corrupted",
}
Get health of service.
include_luna_services | integer Default: 0 Enum: 0 1 Whether to perform healthchecks for dependent LUNA services. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # make request url = f"{baseUri}/healthcheck" response = requests.get(url, params={"include_luna_services": 1}) print(response.status_code) print(response.json())
{- "execution_time": 0.123
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get health of service (redirect).
include_luna_services | integer Default: 0 Enum: 0 1 Whether to perform healthchecks for dependent LUNA services. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests # make request url = f"http://127.0.0.1:5000/healthcheck" response = requests.get(url, params={"include_luna_services": 1}) print(response.status_code) print(response.json())
{- "execution_time": 0.123
}
Get options for the resource (redirect).
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create stream.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
name | string <= 128 characters Default: "" Stream name. |
description | string <= 512 characters Default: "" Stream description. |
required | object (stream_data) |
object (location_to_be_created) Stream location parameters. | |
object (stream_autorestart) Stream autorestart parameters. | |
required | Array of objects (analytics) non-empty list of analytics with its parameters |
group_name | string (group_name) ^[a-zA-Z0-9_\-]{1,128}$ Stream group name. |
{- "name": "",
- "description": "",
- "data": {
- "type": "videofile",
- "downloadable": false,
- "timestamp_source": "auto",
- "rotation": 0,
- "pts": {
- "start_time": 0
}
}, - "location": {
- "city": "Moscow",
- "area": "Central",
- "district": "Basmanny",
- "street": "Podsosensky lane",
- "house_number": "23 bldg.3",
- "geo_position": {
- "longitude": 0,
- "latitude": 0
}
}, - "autorestart": {
- "restart": 0,
- "attempt_count": 10,
- "delay": 60
}, - "analytics": [
- {
- "analytic_name": "some name",
- "parameters": { }
}
], - "group_name": "hd_stream_2"
}
{- "stream_id": "b5d6fd45-fcca-453d-ac05-3e594054b813"
}
Get streams according to filters. The results are sorted by stream creation order, the oldest streams shown first.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
stream_ids | Array of strings <uuid> (uuid) Example: stream_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of stream IDs. |
stream_id__gte | string <uuid> (stream_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: stream_id__gte=ae09126e-70a6-49c7-923f-df2320f08639 Stream id lower included bound. |
stream_id__lt | string <uuid> (stream_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: stream_id__lt=ae09126e-70a6-49c7-923f-df2320f08639 Stream id upper excluded bound. |
names | Array of strings (stream_name) [ items <= 128 characters ] Example: names=name1,name2 Stream name filter. Only streams with the specified names will be returned in the response. |
reference | string (stream_reference) <= 512 characters Example: reference=https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA== Stream reference filter. Only streams with the specified reference will be returned in the response. |
statuses | Array of integers (stream_status) Items Enum: 0 1 2 3 4 5 Example: statuses=pending,stop Stream status filter - comma-separated list of status values. Only streams with the specified statuses will be returned in the response. |
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. |
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. |
agent_id | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: agent_id=557d54ec-29ad-4f3c-93b4-c9092ef12515 Agent ID filter. Only streams associated with the specified id will be returned in the response. |
group_name | string (group_name) ^[a-zA-Z0-9_\-]{1,128}$ Example: group_name=group1 Group name filter. Only groups with the specified names will be returned in the response. |
order | string Default: "desc" Enum: "asc" "desc" Sort order. If "desc" is set, the newest events will be shown first. If "asc" is set, the oldest events will be shown first. |
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/streams" params = { "names": ["some_stream1", "some_stream_2"], } response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "streams": [
- {
- "stream_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "name": "",
- "description": "some description",
- "data": {
- "type": "videofile",
- "downloadable": false,
- "timestamp_source": "auto",
- "rotation": 0,
- "pts": {
- "start_time": 0
}
}, - "location": {
- "city": "string",
- "area": "string",
- "district": "string",
- "street": "string",
- "house_number": "string",
- "geo_position": {
- "longitude": 0,
- "latitude": 0
}
}, - "autorestart": {
- "restart": 0,
- "attempt_count": 10,
- "delay": 60,
- "current_attempt": 0,
- "last_attempt_time": "2018-08-11T09:11:41.674Z",
- "status": "disabled"
}, - "version": 1,
- "create_time": "2018-08-11T09:11:41.674Z",
- "status": 0,
- "last_error": null,
- "groups": [
- "hd_stream_2"
], - "analytics": [
- {
- "analytic_name": "some name",
- "parameters": { }
}
]
}
]
}
Delete streams matching specified filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
stream_ids required | Array of strings <uuid> (stream_id) <= 1000 items Stream ID filter. |
{- "stream_ids": [
- "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
]
}
{- "error_code": 12022,
- "desc": "Bad/incomplete input data",
- "detail": "Failed to validate input json. Path: 'extra', message: 'Extra inputs are not permitted'\n",
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Count streams according to the filters.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
stream_ids | Array of strings <uuid> (uuid) Example: stream_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of stream IDs. |
names | Array of strings (stream_name) [ items <= 128 characters ] Example: names=name1,name2 Stream name filter. Only streams with the specified names will be returned in the response. |
reference | string (stream_reference) <= 512 characters Example: reference=https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA== Stream reference filter. Only streams with the specified reference will be returned in the response. |
statuses | Array of integers (stream_status) Items Enum: 0 1 2 3 4 5 Example: statuses=pending,stop Stream status filter - comma-separated list of status values. Only streams with the specified statuses will be returned in the response. |
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. |
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/streams/count" response = requests.get( url, headers=headers, ) print(response.status_code) print(response.json())
{- "streams_count": 1
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get the stream by ID.
stream_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the stream ( |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create stream headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "name": "post_stream_name", "description": "important stream", "data": { "type": "videofile", "reference": "https://reference.local/video.mp4", }, "analytics": [ { "analytic_name": "example_analytic", "parameters": {} } ], } url = f"{baseUri}/streams" response = requests.post( url, headers=headers, json=payload, ) streamId = response.json()["stream_id"] url = f"{baseUri}/streams/{streamId}" response = requests.get( url, headers=headers, ) print(response.status_code) print(response.json())
{- "stream_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "name": "",
- "description": "some description",
- "data": {
- "type": "videofile",
- "downloadable": false,
- "timestamp_source": "auto",
- "rotation": 0,
- "pts": {
- "start_time": 0
}
}, - "location": {
- "city": "string",
- "area": "string",
- "district": "string",
- "street": "string",
- "house_number": "string",
- "geo_position": {
- "longitude": 0,
- "latitude": 0
}
}, - "autorestart": {
- "restart": 0,
- "attempt_count": 10,
- "delay": 60,
- "current_attempt": 0,
- "last_attempt_time": "2018-08-11T09:11:41.674Z",
- "status": "disabled"
}, - "version": 1,
- "create_time": "2018-08-11T09:11:41.674Z",
- "status": 0,
- "last_error": null,
- "groups": [
- "hd_stream_2"
], - "analytics": [
- {
- "analytic_name": "some name",
- "parameters": { }
}
]
}
Check if stream exists.
stream_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the stream ( |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create stream headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "name": "post_stream_name", "description": "important stream", "data": { "type": "videofile", "reference": "https://reference.local/video.mp4", }, "analytics": [ { "analytic_name": "example_analytic", "parameters": {} } ], } url = f"{baseUri}/streams" response = requests.post( url, headers=headers, json=payload, ) streamId = response.json()["stream_id"] url = f"{baseUri}/streams/{streamId}" response = requests.head( url, headers=headers, ) print(response.status_code)
{- "error_code": 11062,
- "desc": "Forbidden",
- "detail": "Specified token corrupted",
}
Update existing stream. You should specify all the fields required for the stream in the request.
stream_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the stream ( |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
name | string <= 128 characters Default: "" Stream name. |
description | string <= 512 characters Default: "" Stream description. |
required | object (stream_data) |
object (location_to_be_created) Stream location parameters. | |
object (stream_autorestart) Stream autorestart parameters. | |
required | Array of objects (analytics) non-empty list of analytics with its parameters |
group_name | string (group_name) ^[a-zA-Z0-9_\-]{1,128}$ Stream group name. |
{- "name": "",
- "description": "",
- "data": {
- "type": "videofile",
- "downloadable": false,
- "timestamp_source": "auto",
- "rotation": 0,
- "pts": {
- "start_time": 0
}
}, - "location": {
- "city": "Moscow",
- "area": "Central",
- "district": "Basmanny",
- "street": "Podsosensky lane",
- "house_number": "23 bldg.3",
- "geo_position": {
- "longitude": 0,
- "latitude": 0
}
}, - "autorestart": {
- "restart": 0,
- "attempt_count": 10,
- "delay": 60
}, - "analytics": [
- {
- "analytic_name": "some name",
- "parameters": { }
}
], - "group_name": "hd_stream_2"
}
{- "stream_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "version": 1
}
Pause/unpause stream
stream_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the stream ( |
action required | string Enum: "stop" "resume" stop - stop stream processing, stream status will be switched to |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests import time baseUri = "http://127.0.0.1:5000/6" # create stream headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "name": "post_stream_name", "description": "important stream", "data": { "type": "videofile", "reference": "https://reference.local/video.mp4", }, "analytics": [ { "analytic_name": "example_analytic", "parameters": {} } ], } url = f"{baseUri}/streams" response = requests.post( url, headers=headers, json=payload, ) streamId = response.json()["stream_id"] time.sleep(5) url = f"{baseUri}/streams/{streamId}?action=stop" response = requests.patch( url, headers=headers, ) print(response.status_code)
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'action'",
}
Remove the stream by ID.
stream_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the stream ( |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create stream headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "name": "post_stream_name", "description": "important stream", "data": { "type": "videofile", "reference": "https://reference.local/video.mp4", }, "analytics": [ { "analytic_name": "example_analytic", "parameters": {} } ], } url = f"{baseUri}/streams" response = requests.post( url, headers=headers, json=payload, ) streamId = response.json()["stream_id"] url = f"{baseUri}/streams/{streamId}" response = requests.delete( url, headers=headers, ) print(response.status_code)
{- "error_code": 11062,
- "desc": "Forbidden",
- "detail": "Specified token corrupted",
}
Get options for the resource.
stream_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the stream ( |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
stream_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the stream ( |
Luna-Account-Id | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Deprecated Example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a Account ID. An account is a limitation for all the user actions (matching, removing, updating and other) on data which does not have corresponding account ID. For example: it is impossible to attach a face with one account ID to a list with another account ID. User can make a limited set of requests without this header (requests with methods GET, HEAD, OPTIONS, match requests and getting events statistics requests). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
from luna3.lunavl.httpclient import LunaHttpClient EXPECTED_EVENT_COUNT = 100 client = LunaHttpClient(origin='http://127.0.0.1:5000', api=6, login="luna@visionlabs.ru", password="luna") with client.streamsWsConnect(streamId="5818e68c-12ad-4a8b-96fe-5037225d61eb") as ws: for _ in range(EXPECTED_EVENT_COUNT): WS_RESP = ws.recv() print(WS_RESP)
{- "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
]
]
}
}
}
Get streams logs according to filters. The results are sorted by log creation order, the new streams logs shown first.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
stream_ids | Array of strings <uuid> (uuid) Example: stream_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of stream IDs. |
statuses | Array of integers (stream_status) Items Enum: 0 1 2 3 4 5 Example: statuses=pending,stop Stream status filter - comma-separated list of status values. Only streams with the specified statuses will be returned in the response. |
targets | Array of strings Default: ["stream_id","status","error","log_time"] Items Enum: "stream_id" "status" "error" "log_time" Example: targets=status List of comma-separated stream logs targets. |
log_time__lt | string <date-time> (time) Example: log_time__lt=2021-09-21T19:11:41.674Z Stream log record time upper excluding bound filter in RFC 3339 format. Only stream logs with the record time lower than the specified boundary will be returned in the response. |
log_time__gte | string <date-time> (time) Example: log_time__gte=2021-09-21T11:11:41.674Z Stream log record time lower including bound filter in RFC 3339 format. Only stream log with the record time greater than or equal to the specified boundary will be returned in the response. |
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/streams/logs" params = { "targets": "error,log_time", } response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "logs": [
- {
- "stream_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "log_time": "string",
- "error": null,
- "status": 0
}
]
}
Delete streams logs older than specified date excluding last log entry.
log_time__lt | string <date-time> (time) Example: log_time__lt=2021-09-21T19:11:41.674Z Stream log record time upper excluding bound filter in RFC 3339 format. Only stream logs with the record time lower than the specified boundary will be deleted. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/streams/logs" params = { "log_time__lt": "2021-09-21T19:11:41.674Z", } response = requests.delete(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "deleted_count": 1000
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Attach (or detach) streams to a group.
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
action required | string Enum: "attach" "detach" Action to perform: attach or detach streams to group. |
stream_ids required | Array of strings <uuid> (uuid) <= 1000 items Stream IDs. |
group_id required | string <uuid> (group_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Stream group ID. |
{- "action": "attach",
- "stream_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "group_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
}
{- "error_code": 12022,
- "desc": "Bad/incomplete input data",
- "detail": "Failed to validate input json. Path: 'extra', message: 'Extra inputs are not permitted'\n",
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Create group.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
group_name required | string (group_name) ^[a-zA-Z0-9_\-]{1,128}$ Stream group name. |
description | string <= 256 characters Default: "" Stream group description. |
{- "group_name": "hd_stream_2",
- "description": ""
}
{- "group_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b"
}
Get groups according to filters. The results are sorted by group creation order, the oldest group shown first.
group_ids | Array of strings <uuid> (group_id) Example: group_ids=ae09126e-70a6-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce Group IDs. |
group_names | Array of strings (group_name) Example: group_names=group1,group2 Group names. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/groups" params = { "group_names": ["some_group1", "some_group2"], } response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "groups": [
- {
- "account_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
- "group_name": "stream_group-1",
- "group_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "description": "default stream group",
- "create_time": "2018-08-11T09:11:41.674Z"
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Count of groups according to the filters.
group_ids | Array of strings <uuid> (group_id) Example: group_ids=ae09126e-70a6-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce Group IDs. |
group_names | Array of strings (group_name) Example: group_names=group1,group2 Group names. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/groups/count" response = requests.get( url, headers=headers, ) print(response.status_code) print(response.json())
{- "groups_count": 7
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get the group by name.
group_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the group ( |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create group headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "group_name": "group_name_get", "description": "a group" } url = f"{baseUri}/groups" response = requests.post( url, headers=headers, json=payload, ) groupId = response.json()["group_id"] url = f"{baseUri}/groups/{groupId}" response = requests.get( url, headers=headers, ) print(response.status_code) print(response.json())
{- "account_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
- "group_name": "stream_group-1",
- "group_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "description": "default stream group",
- "create_time": "2018-08-11T09:11:41.674Z"
}
Update group fields: description
group_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the group ( |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Content-Type | string Value: "application/json" Content type is |
description required | string <= 256 characters Stream group description. |
{- "description": "old stream group"
}
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Remove the group by name.
group_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the group ( |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" # create group headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } payload = { "group_name": "group_name_delete", "description": "a group" } url = f"{baseUri}/groups" response = requests.post( url, headers=headers, json=payload, ) groupId = response.json()["group_id"] url = f"{baseUri}/groups/{groupId}" response = requests.delete( url, headers=headers, ) print(response.status_code)
{- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
}
Get options for the resource.
group_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the group ( |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get analytics according to filters. The results are sorted by analytic creation order, the oldest analytics shown first.
analytic_ids | Array of strings <uuid> (analytic_id) Example: analytic_ids=ae09126e-80a9-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce Analytics ID filter. Only analytics with the specified ids will be returned in the response. |
analytic_id__gte | string <uuid> (analytic_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: analytic_id__gte=ae09126e-70a6-49c7-923f-df2320f08639 Analytic id lower included bound. |
analytic_id__lt | string <uuid> (analytic_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: analytic_id__lt=ae09126e-70a6-49c7-923f-df2320f08639 Analytic id upper excluded bound. |
create_time__lt | string <date-time> (time) Example: create_time__lt=2018-08-11T09:11:41.674Z Upper bound for object create_time. |
create_time__gte | string <date-time> (time) Example: create_time__gte=2018-08-11T09:11:41.674Z Lower included bound for object create_time. |
names | Array of strings (analytic_name) [ items <= 36 characters ^[a-zA-Z0-9_\-]{1,36}$ ] Example: names=name1,name2 Analytic name filter. Only streams with the specified names will be returned in the response. |
order | string Default: "desc" Enum: "asc" "desc" Sort order. If "desc" is set, the newest events will be shown first. If "asc" is set, the oldest events will be shown first. |
page | integer Default: 1 Page number. If value is lower than 1, then page number will be set to 1 |
page_size | integer <= 1000 Default: 10 Number of items on page. If value is lower than 1, then page number will be set to 1 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/analytics" params = { "names": "example_analytic", } response = requests.get(url, headers=headers, params=params) print(response.status_code) print(response.json())
{- "analytics": [
- {
- "analytic_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "analytic_name": "some name",
- "description": "",
- "analytic_version": 1,
- "default_parameters": { },
- "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z",
- "validation_schema": { }
}
]
}
Get options for the resource.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get the analytic by ID.
analytic_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the analytic. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/analytics/43b8f72b-769a-48e1-a69c-7150fae2db3c" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "analytic_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "analytic_name": "some name",
- "description": "",
- "analytic_version": 1,
- "default_parameters": { },
- "create_time": "2018-08-11T09:11:41.674Z",
- "last_update_time": "2018-08-11T09:11:41.674Z",
- "validation_schema": { }
}
Get options for the resource.
analytic_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the analytic. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get the analytic documentation by ID.
analytic_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the analytic. |
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
Accept | string Value: "text/html" Preferred response content type |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=", } url = f"{baseUri}/analytics/43b8f72b-769a-48e1-a69c-7150fae2db3c/docs" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
"string"
Get options for the resource.
analytic_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the analytic. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
{- "error_code": 37002,
- "desc": "Request timeout",
- "detail": "Service did not receive a complete request message within 60 seconds",
}
Get statistics of success and failed requests to the service in prometheus format.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response. |
# HELP request_count_total Counter of requests # TYPE request_count_total counter request_count_total{path="GET:/healthcheck",status_code="200"} 1.0 # HELP requests Histogram of request time metrics # TYPE requests histogram requests_sum{route="GET:/healthcheck",status_code="200"} 0.005269583023618907 requests_bucket{le="0.0001",route="GET:/healthcheck",status_code="200"} 0.0 requests_bucket{le="0.00025",route="GET:/healthcheck",status_code="200"} 0.0 requests_bucket{le="0.0005",route="GET:/healthcheck",status_code="200"} 0.0 requests_bucket{le="0.001",route="GET:/healthcheck",status_code="200"} 0.0 requests_bucket{le="0.0025",route="GET:/healthcheck",status_code="200"} 0.0 requests_bucket{le="0.005",route="GET:/healthcheck",status_code="200"} 0.0 requests_bucket{le="0.01",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="0.025",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="0.05",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="0.075",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="0.1",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="0.25",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="0.5",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="0.75",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="1.0",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="2.5",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="5.0",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="7.5",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="10.0",route="GET:/healthcheck",status_code="200"} 1.0 requests_bucket{le="+Inf",route="GET:/healthcheck",status_code="200"} 1.0 requests_count{route="GET:/healthcheck",status_code="200"} 1.0