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
}
}
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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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.
image_type | integer Default: 0 Enum: 0 1 2 Type of input image. 0 - raw image, 1 - face warped image, 2 - body warped image. | ||||||||
multiface_policy | integer (multiface_policy) Default: 1 Enum: 0 1 2 Multiple face detection policy:
| ||||||||
detect_face | integer Default: 0 Enum: 0 1 Whether to detect faces on the image. | ||||||||
detect_body | integer 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 V2 is utilized for this estimation. See "Administrator’s manual" for details about Liveness V2 requirements. ⚠ Webcam or selfie photos are required. Otherwise the result may be incorrect. ⚠ Liveness v.2 licensing feature is required to be enabled to perform liveness estimation. Liveness estimation is not supported for samples (warped images). The | ||||||||
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_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) Default: 0 Whether to aggregate face/body attributes (descriptor for face/body and basic attributes for face), as well as mask states, emotions and liveness parameters. Aggregation will be performed only if the appropriate parameters for extracting attributes and/or estimating the mask states, emotions and liveness are enabled. If set, all extracted attributes and mask states, emotions and liveness parameters from each image will be aggregated and displayed in the "aggregate_estimations" field of the response body as single objects for all images. Otherwise, all extracted face/body attributes and mask states, emotions and liveness parameters from each image will be displayed in the "estimations" field of the response body as separate objects for corresponding images. | ||||||||
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 ( | ||||||||
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.
| ||||||||
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 |
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]... 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",
- "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
}
}, - "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": 0.7361597418785095,
- "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
}
}
}
}
}
]
}
]
}
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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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.
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
}
]
}, - "rect": {
- "x": 108,
- "y": 58,
- "width": 113,
- "height": 165
}
}
}
}
]
}
]
}
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.
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 |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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 required | 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. 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, request to sdk resource 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Save face or body sample to the storage.
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. |
Luna-Account-Id required | 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. 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, request to sdk resource 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Get 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/samples/faces/{sampleId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.json())
{- "error_code": 13003,
- "desc": "Object not found",
- "detail": "Image with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found"
}
Check if face or body sample with sample_id
exists.
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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 required | 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. 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, request to sdk resource 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/samples/faces/{sampleId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 11036,
- "desc": "Forbidden",
- "detail": "Luna-Account-Id header is required for requests that change the state of system"
}
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.
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]... 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": 13003,
- "desc": "Object not found",
- "detail": "Image with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found"
}
Check if face or body sample with sample_id
exists 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]... 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
{- "error_code": 11036,
- "desc": "Forbidden",
- "detail": "Luna-Account-Id header is required for requests that change the state of system"
}
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.
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]... 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": 13003,
- "desc": "Object not found",
- "detail": "Image with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found"
}
Check if face sample with sample_id
exists.
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]... 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
{- "error_code": 11036,
- "desc": "Forbidden",
- "detail": "Luna-Account-Id header is required for requests that change the state of system"
}
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.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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 required | 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. 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, request to sdk resource 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Check if image with image_id
exists.
image_id required | string <uuid> (image_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 141d2706-8baf-433b-82eb-8c7fada847da 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/images/{imageId}" response = requests.head(url, headers=headers) print(response.status_code)
{- "error_code": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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: 141d2706-8baf-433b-82eb-8c7fada847da 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 required | 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. 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, request to sdk resource 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/images/{imageId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 11036,
- "desc": "Forbidden",
- "detail": "Luna-Account-Id header is required for requests that change the state of system"
}
Receive an origin image.
image_id required | string <uuid> (image_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 141d2706-8baf-433b-82eb-8c7fada847da 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/images/{imageId}" response = requests.get(url, headers=headers) print(response.status_code)
{- "error_code": 13003,
- "desc": "Object not found",
- "detail": "Image with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found"
}
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: 141d2706-8baf-433b-82eb-8c7fada847da 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Save object with unique ID.
Luna-Account-Id required | 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. 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, request to sdk resource 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 Enum: "application/json" "application/pdf" "application/zip" "text/plain" Type of transferring information, available - |
Content type is application/json
.
{- "content": "json"
}
{- "object_id": "141d2706-8baf-433b-82eb-8c7fada847da",
- "url": "/6/objects/141d2706-8baf-433b-82eb-8c7fada847da"
}
get options for the resource
Luna-Account-Id required | 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. 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, request to sdk resource 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
receiving objects
object_id required | string <uuid> (object_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 141d2706-8baf-433b-82eb-8c7fada847da 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. |
Accept | string (objects_accept) Enum: "application/json" "text/plain" "application/zip" "application/pdf" Acceptable type of receiving data. |
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. 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/objects/{objectId}" response = requests.get(url, headers=headers) print(response.status_code) print(response.text)
{- "json": "example"
}
Check if object with object_id
exists.
object_id required | string <uuid> (object_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 141d2706-8baf-433b-82eb-8c7fada847da 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. |
Accept | string (objects_accept) Enum: "application/json" "text/plain" "application/zip" "application/pdf" Acceptable type of receiving data. |
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. 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/objects/{objectId}" response = requests.head(url, headers=headers) print(response.status_code)
{- "error_code": 13007,
- "desc": "Object not found",
- "detail": "Object with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found"
}
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: 141d2706-8baf-433b-82eb-8c7fada847da 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 required | 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. 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, request to sdk resource 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/objects/{objectId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 11036,
- "desc": "Forbidden",
- "detail": "Luna-Account-Id header is required for requests that change the state of system"
}
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: 141d2706-8baf-433b-82eb-8c7fada847da 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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) Default: 0 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 required | 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. 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, request to sdk resource 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,
- "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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 required | 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. 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, request to sdk resource 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_base64 (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) 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": 1,
- "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 | string <list of uuid> Comma-separated list of attribute IDs. |
targets | string <comma-separated items> Default: "create_time, attribute_id, account_id, 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 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": [
- {
- "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
}
}
]
}
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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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: b668c4a5-2191-476e-a261-3b4f9ce2e25e ID of the temporary attribute. |
descriptor_version | integer (descriptor_version) Enum: 46 52 54 56 57 58 59 Example: descriptor_version=56 Descriptor version returned in the response. By default, the LUNA PLATFORM default descriptor version is used. |
targets | string <comma-separated items> Default: "create_time, attribute_id, account_id, 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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: b668c4a5-2191-476e-a261-3b4f9ce2e25e 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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: b668c4a5-2191-476e-a261-3b4f9ce2e25e 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
# This example is written using requests library import requests # create attribute headers = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"http://127.0.0.1:5000/6/attributes/{attributeId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 11036,
- "desc": "Forbidden",
- "detail": "Luna-Account-Id header is required for requests that change the state of system"
}
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: b668c4a5-2191-476e-a261-3b4f9ce2e25e 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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: b668c4a5-2191-476e-a261-3b4f9ce2e25e 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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"
]
}
Create new 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 required | 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. 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, request to sdk resource 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:
| |
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> ^[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.
page | integer >= 1 Default: 1 Page number. |
page_size | integer [ 1 .. 100 ] Default: 10 Number of items on page. |
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 |
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 |
face_ids | string <list of uuid> Example: face_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of face IDs. |
external_ids | string 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 | string 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]... 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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.
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 required | 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. 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, request to sdk resource 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Count faces 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. |
face_ids | string <list of 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 | string 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]... 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Count faces with attributes.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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]... 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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 | string 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]... 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/faces" faceId = requests.post(url, headers=headers).json()["face_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 required | 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. 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, request to sdk resource 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 <uuid> Nullable ^[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.
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 required | 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. 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, request to sdk resource and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = {"Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} url = f"{baseUri}/faces" faceId = requests.post( url, headers=headers, ).json()["face_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/faces/{faceId}" response = requests.delete( url, headers=headers, ) print(response.status_code)
{- "error_code": 11036,
- "desc": "Forbidden",
- "detail": "Luna-Account-Id header is required for requests that change the state of system"
}
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). |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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]... 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/faces" faceId = requests.post( url, headers=headers, ).json()["face_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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 required | 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. 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, request to sdk resource 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 ( |
targets | string <comma-separated items> Default: "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 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 required | 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. 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, request to sdk resource 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 = {"Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Create new 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 required | 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. 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, request to sdk resource 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.
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 | string <list of uuid> 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 >= 1 Default: 1 Page number. |
page_size | integer [ 1 .. 100 ] Default: 10 Number of items on page. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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]... 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 required | 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. 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, request to sdk resource 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Count lists according to the filters.
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 | string <list of uuid> 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]... 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/lists" listId = requests.post(url, headers=headers).json()["list_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
user_data | string <= 128 characters User data associated with list. |
{- "user_data": "list of good persons"
}
{- "error_code": 11036,
- "desc": "Forbidden",
- "detail": "Luna-Account-Id header is required for requests that change the state of system"
}
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 required | 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. 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, request to sdk resource 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } params = {"with_faces": 1} url = f"{baseUri}/lists/{listId}" response = requests.delete(url, params=params, headers=headers) print(response.status_code)
{- "error_code": 11036,
- "desc": "Forbidden",
- "detail": "Luna-Account-Id header is required for requests that change the state of system"
}
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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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 required | 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. 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, request to sdk resource 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) non-empty Faces to attach or detach to/from list. |
{- "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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.
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]... 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 | Array of candidate_face (object) or candidate_event (object) or candidate_attribute (object) [ 0 .. 30 ] items Candidates for matching. |
required | Array of face_reference (object) or event_reference (object) or attribute_reference (object) or external_face_reference (object) or external_event_reference (object) or track_event_reference (object) or xpk_reference (object) or sdk_descriptor_reference (object) or raw_descriptor_reference (object) [ 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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.
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]... 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 | Array of event_reference (object) or external_event_reference (object) or track_event_reference (object) or sdk_descriptor_reference (object) or raw_body_descriptor_reference (object) [ 1 .. 30 ] items Reference list for matching. |
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
], - "masks": [
- 1
], - "ethnic_groups": [
- 4,
- 3
], - "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "user_data": "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"
], - "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",
- "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,
- "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",
- "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,
- "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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]... 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 | 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Create new handler.
The handler determines the list of rules (policies) for processing of input images.
Handlers can be static or dynamic.
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 specifying "is_dynamic" flag.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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 required | 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. 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, request to sdk resource 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. | |
is_dynamic | boolean (is_dynamic) 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. |
{- "description": "Full handler example",
- "policies": {
- "detect_policy": {
- "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_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
], - "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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": 91.1,
- "max": 92.2
}
}, - "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": 1000
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1000
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 1000
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "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.1,
- "max": 0.9
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.1,
- "max": 0.9
}
}
}
}
}, - "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
]
}, - "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
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}, - "body_sample_policy": {
- "store_sample": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}, - "image_origin_policy": {
- "store_image": 1,
- "use_external_references": 1,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}, - "attribute_policy": {
- "store_attribute": 1,
- "ttl": 300,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 1
], - "age__lt": 0,
- "age__gte": 0,
- "liveness": [
- 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
], - "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
], - "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
], - "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
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.9
}
]
}
}
}, - "conditional_tags_policy": [
- {
- "tag": "new_tag",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 50,
- "age__gte": 22,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.3
}
]
}
}
]
}, - "is_dynamic": false
}
{- "handler_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "url": "/6/handlers/b5d6fd45-fcca-453d-ac05-3e594054b813"
}
Get handlers by filters.
page | integer >= 1 Default: 1 Page number. |
page_size | integer [ 1 .. 100 ] Default: 10 Number of items on page. |
is_dynamic | integer Default: 0 Enum: 0 1 Whether to get only dynamic (1) or non-dynamic (0) handlers. |
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]... 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", "is_dynamic": 1, "page": 1, } headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": {
- "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_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
], - "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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.3,
- "max": 0.9
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 91.1,
- "max": 92.2
}
}, - "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": 100
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "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.1,
- "max": 0.9
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.1,
- "max": 0.9
}
}
}
}
}, - "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
}
]
}
}, - "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
}
]
}
}, - "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
}
]
}
}, - "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
}
]
}
}
}, - "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",
- "is_dynamic": false
}, - {
- "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": {
- "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,
- "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
], - "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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.3,
- "max": 0.9
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 91.1,
- "max": 92.2
}
}, - "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": 100
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "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.1,
- "max": 0.9
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.1,
- "max": 0.9
}
}
}
}
}, - "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
}, - "body_sample_policy": {
- "filters": { },
- "store_sample": 1
}, - "image_origin_policy": {
- "filters": { },
- "store_image": 0,
- "use_external_references": 0
}, - "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
}
}
}, - "is_dynamic": false
}
]
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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Count handlers.
description | string Find all the handlers with description similar to this parameter. |
is_dynamic | integer Default: 0 Enum: 0 1 Whether to get only dynamic (1) or non-dynamic (0) handlers. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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]... 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } params = { "description": "handler", "is_dynamic": 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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 required | 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. 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, request to sdk resource 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": {
- "detect_face": 0,
- "detect_body": 0,
- "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": [ ],
- "estimate_liveness": {
- "estimate": 0,
- "liveness_threshold": 0,
- "quality_threshold": 0
}, - "liveness_states": [ ],
- "face_quality": {
- "estimate": 0,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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": 91.1,
- "max": 92.2
}
}, - "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": 0
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "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
}, - "red_eyes": {
- "estimate": 1,
- "threshold": 0
}, - "radial_distortion": {
- "estimate": 1,
- "threshold": 0
}, - "illumination_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}
}
}
}, - "extract_policy": {
- "extract_basic_attributes": 0,
- "extract_face_descriptor": 1,
- "fd_score_threshold": 0.7,
- "extract_body_descriptor": 0
}, - "match_policy": [
- {
- "label": "good guys",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
]
}, - "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": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}, - "body_sample_policy": {
- "store_sample": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}, - "image_origin_policy": {
- "store_image": 0,
- "use_external_references": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}, - "attribute_policy": {
- "store_attribute": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 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
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "set_sample_as_avatar": 0,
- "link_to_lists_policy": [
- {
- "list_id": "string",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}
]
}, - "event_policy": {
- "store_event": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "wait_saving": 0
}, - "notification_policy": {
- "send_notification": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 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
], - "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 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]... 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 = {"Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} url = f"{baseUri}/handlers" payload = {"is_dynamic": True} dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"] # get handler headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": {
- "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_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
], - "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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.3,
- "max": 0.9
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 91.1,
- "max": 92.2
}
}, - "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": 100
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "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.4,
- "max": 0.9
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.4,
- "max": 0.9
}
}
}
}
}, - "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
}
]
}
}, - "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
}
]
}
}, - "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
}
]
}
}, - "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
}
]
}
}
}, - "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",
- "is_dynamic": false
}
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 required | 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. 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, request to sdk resource 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. | |
is_dynamic | boolean (is_dynamic) 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. |
{- "description": "Handler example",
- "policies": {
- "detect_policy": {
- "detect_face": 0,
- "detect_body": 0,
- "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": [ ],
- "estimate_liveness": {
- "estimate": 0,
- "liveness_threshold": 0,
- "quality_threshold": 0
}, - "liveness_states": [ ],
- "face_quality": {
- "estimate": 0,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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": 91.1,
- "max": 92.2
}
}, - "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": 0
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "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
}, - "red_eyes": {
- "estimate": 1,
- "threshold": 0
}, - "radial_distortion": {
- "estimate": 1,
- "threshold": 0
}, - "illumination_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}
}
}
}, - "extract_policy": {
- "extract_basic_attributes": 0,
- "extract_face_descriptor": 1,
- "fd_score_threshold": 0.7,
- "extract_body_descriptor": 0
}, - "match_policy": [
- {
- "label": "good guys",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
]
}, - "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": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}, - "body_sample_policy": {
- "store_sample": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}, - "image_origin_policy": {
- "store_image": 0,
- "use_external_references": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}, - "attribute_policy": {
- "store_attribute": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 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
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "set_sample_as_avatar": 0,
- "link_to_lists_policy": [
- {
- "list_id": "string",
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}
]
}, - "event_policy": {
- "store_event": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 1
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}, - "wait_saving": 0
}, - "notification_policy": {
- "send_notification": 0,
- "filters": {
- "gender": 1,
- "ethnicities": [
- 4,
- 3
], - "age__lt": 30,
- "age__gte": 22,
- "liveness": [
- 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
], - "match": [
- {
- "label": "good guys",
- "similarity__lte": 0.9,
- "similarity__gte": 0.78
}
]
}
}
]
}, - "is_dynamic": false
}
{- "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]... 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-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} url = f"{baseUri}/handlers" payload = {"is_dynamic": True} dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
import requests baseUri = "http://127.0.0.1:5000/6" headers = {"Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} url = f"{baseUri}/handlers" payload = {"is_dynamic": True} dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"] headers = { "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/handlers/{dynamicHandlerId}" response = requests.delete(url, headers=headers) print(response.status_code)
{- "error_code": 11036,
- "desc": "Forbidden",
- "detail": "Luna-Account-Id header is required for requests that change the state of system"
}
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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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:
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 faces. 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 faces. |
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) Default: 0 Whether to aggregate face/body attributes (descriptor for face/body and basic attributes for face), as well as mask states, emotions and liveness parameters. Aggregation will be performed only if the appropriate parameters for extracting attributes and/or estimating the mask states, emotions and liveness are enabled in the handler. If set, all extracted attributes and mask states, emotions and liveness parameters from each image will be aggregated and stored in the event as single objects for all images. In the response body, the aggregated attributes of all images will be displayed in the "face_attributes" > "basic_attributes" field, and the aggregated mask state, emotion and Liveness parameters will be displayed in the "aggregate_estimations" field. Otherwise, all extracted attributes and mask states, emotions and liveness parameters from each image will be stored in the event as separate objects. In the response body, the attributes will be displayed in the "face_attributes" > "basic_attributes" field of the corresponding image, and the mask states, emotions and Liveness parameters will be displayed in the "detections" > "attributes" field of the corresponding image. |
source | string (source) <= 128 characters Example: source=3rd Avenue Additional information provided by user along with event. |
tags | Array of strings (tag) >= 0 items 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 required | 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. 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, request to sdk resource 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"
}
}
], - "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",
- "tags": [
- "tag1",
- "tag2"
], - "external_id": "b668c4a5-2191-some-important-words",
- "user_data": "string",
- "face": {
- "face_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "account_id": "d5c0a8c6-5509-4e5b-8a01-e2ab426542d6",
- "event_id": "f9687459-986b-406d-9c1f-0d6289be5256",
- "user_data": "fox1991",
- "create_time": "2018-08-11T09:11:41.674Z",
- "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"
}, - "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
}
}, - "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"
}, - "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
}
]
}
}, - "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",
- "aggregate_estimations": {
- "face": {
- "attributes": {
- "liveness": {
- "prediction": "real",
- "estimations": {
- "quality": 0.9,
- "score": 0.8
}
}
}
}
}
}
], - "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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 required | 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. 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, request to sdk resource 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. |
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 <= 30 items Nullable Sorted list with match result for the event. | |
object (input_event_face_attribute) Nullable User extracted event face attributes. | |
object (input_event_body_attribute) Nullable User extracted event body attributes. | |
object (event_aggregate_estimations) Aggregated attributes estimated from samples. | |
tags | Array of strings [ 0 .. 100 ] items List of tags. |
create_time | string <date-time> Time of the event creation. |
end_time | string <date-time> The end time of the event. |
{- "detections": [
- {
- "filename": "",
- "samples": {
- "body": {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "rect": {
- "height": 240,
- "width": 209,
- "x": 170,
- "y": 198
}
}, - "url": "/6/samples/bodies/45838c8b-04a1-4230-bda0-b5f77609b695"
}, - "face": {
- "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
- "detection": {
- "attributes": {
- "mouth_attributes": {
- "occluded": 0,
- "score": 0.999999165534973,
- "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"
}, - "head_pose": {
- "pitch": 18.6827487945557,
- "roll": -10.3542232513428,
- "yaw": 15.4102487564087
}, - "gaze": {
- "pitch": 9.26744079589844,
- "yaw": -19.4657287597656
}, - "liveness": {
- "prediction": "spoof",
- "estimations": {
- "quality": 0.347,
- "score": 0.9345
}
}
}, - "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": [ ],
- "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",
- "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"
}, - "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": 0,
- "indian": 0,
- "caucasian": 0,
- "african_american": 0
}
}
}, - "score": 1,
- "samples": {
- "samples": [
- "0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c",
- "2f1cbb34-12e5-486c-8f7f-57273053c32d"
]
}, - "descriptor": "string",
- "url": "string"
}, - "body_attributes": {
- "score": 1,
- "samples": {
- "samples": [
- "0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c",
- "2f1cbb34-12e5-486c-8f7f-57273053c32d"
]
}, - "descriptor": "string"
}, - "aggregate_estimations": {
- "face": {
- "attributes": {
- "liveness": {
- "prediction": "spoof",
- "estimations": {
- "quality": 0,
- "score": 0
}
}, - "mask": {
- "estimations": {
- "medical_mask": 0,
- "missing": 0,
- "occluded": 0
}, - "predominant_mask": "medical_mask"
}, - "emotions": {
- "estimations": {
- "anger": 0,
- "disgust": 0,
- "fear": 0,
- "happiness": 0,
- "neutral": 0,
- "sadness": 0,
- "surprise": 0
}, - "predominant_emotion": "surprise"
}
}
}
}, - "tags": [
- "tag1",
- "tag2"
], - "create_time": "2018-08-11T09:11:41.674Z",
- "end_time": "2018-08-11T09:11:41.674Z"
}
{- "event_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "url": "/6/events/b5d6fd45-fcca-453d-ac05-3e594054b813"
}
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]... 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: 1) Grouping by time intervals - number and dimension
2) The frequency grouping - one of the following
|
{- "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:00.000Z"
}, - {
- "operator": "lt",
- "value": "2020-02-06T00:00:00.000Z"
}
], - "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Get events that satisfy filters.
Default filters for events:
create_time__lt
- current date and time
create_time__gte
- current date and time minus month
Default filters are not used if any of the following parameters are defined:
event_ids
)event_id__gte
)event_id__lt
)create_time__gte
)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.
target | string Enum: "create_time" "end_time" "event_id" "handler_id" "external_id" "source" "top_match" "match_result" "face_detections" "face_id" "attach_result" "gender" "age" "emotion" "ethnic_group" "liveness" "body_detections" "tags" "user_data" "location" "mask" "track_id" 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. | ||||||||||||||||
sources | string Example: sources=cam1,cam2 Comma-separated list of sources. Each event from result will contain one of given sources. | ||||||||||||||||
cities | string Example: cities=Moscow,New York Comma-separated list of cities. Each event from result will contain one of given cities in "location" parameter. | ||||||||||||||||
areas | string Example: areas=CAD,Manhattan Comma-separated list of areas. Each event from result will contain one of given areas in "location" parameter. | ||||||||||||||||
districts | string Example: districts=Mitino,Midtown Comma-separated list of districts. Each event from result will contain one of given districts in "location" parameter. | ||||||||||||||||
streets | string 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 | string 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. | ||||||||||||||||
origin_longitude | number (longitude) [ -180 .. 180 ] Example: origin_longitude=36.616 Longitude origin 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. NOTE: highly recommended for citywide use only. | ||||||||||||||||
origin_latitude | number (latitude) [ -90 .. 90 ] Example: origin_latitude=55.752 Latitude origin 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. NOTE: highly recommended for citywide use only. | ||||||||||||||||
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) 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. | ||||||||||||||||
gender | integer Enum: 0 1 Example: gender=1 Gender. 1 - male, 0 - female. | ||||||||||||||||
emotions | string <list of integer (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 given emotions.
| ||||||||||||||||
masks | string <list of integer (1, 2, 3)> Example: masks=1,2,3 Comma-separated list of predominant mask states. Each event from result will contain one of given mask states.
| ||||||||||||||||
ethnic_groups | string <list of integer (1, 2, 3, 4)> Example: ethnic_groups=1,2 Comma-separated list of dominant ethnic groups. Each event from result will contain one of given ethnic groups.
| ||||||||||||||||
liveness | string <list of integer (0, 1 ,2)> Example: liveness=1,2 Comma-separated list of dominant liveness. Each event from result will contain one of given liveness.
| ||||||||||||||||
face_ids | string <list of uuid> Example: face_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of face IDs. | ||||||||||||||||
event_ids | string <list of 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. | ||||||||||||||||
event_id__lt | string <uuid.> Example: event_id__lt=346a5645-ec89-4806-820a-dbcb6e0dc381 Event ID upper excluded bound. | ||||||||||||||||
handler_ids | string <list of uuid.> Example: handler_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of handler IDs. | ||||||||||||||||
external_ids | string 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 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_ids | string^([a-zA-Z0-9_\-](1, 36))(,[a-zA-Z0-9_\-](1, 3... Example: track_ids=track_id_number_1,track_id_number_2 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. | ||||||||||||||||
order | string 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 >= 1 Default: 1 Page number. | ||||||||||||||||
page_size | integer [ 1 .. 1000 ] Default: 10 Number of items on page. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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]... 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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",
- "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"
}, - "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
}, - {
- "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
}
]
}
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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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 | string Enum: "create_time" "end_time" "event_id" "handler_id" "external_id" "source" "top_match" "match_result" "face_detections" "face_id" "attach_result" "gender" "age" "emotion" "ethnic_group" "liveness" "body_detections" "tags" "user_data" "location" "mask" "track_id" 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]... 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 = {"Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} url = f"{baseUri}/handlers" payload = { "description": "non_dynamic_handler", "policies": {}, "is_dynamic": False, } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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",
- "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"
}, - "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"
}
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. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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]... 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 = {"Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} url = f"{baseUri}/handlers" payload = { "description": "non_dynamic_handler", "policies": {}, "is_dynamic": False, } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", "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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } url = f"{baseUri}/events/{eventId}" response = requests.head(url, headers=headers) print(response.status_code)
{- "error_code": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
description | string User data provided for the current task. |
required | object (clustering_task_content) Clustering task content. |
{- "description": "clustering faces",
- "content": {
- "objects_type": "faces",
- "filters": {
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "account_id": "string"
}, - "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
description | string Provided user data for the current task. |
required | object (ReporterTaskContent) Reporter task content. |
{- "description": "report clustering events from cam1",
- "content": {
- "filters": {
- "task_id": 146,
- "account_id": "string"
}, - "columns": [
- "face_id",
- "user_data",
- "create_time"
], - "csv_delimiter": "$",
- "save_images": 1
}
}
{- "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
description | string (task_description) <= 128 characters Task description. |
required | any Exporter task content. |
{- "description": "task description",
- "content": {
- "objects_type": "string",
- "filters": {
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515"
}, - "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
description | string User data provided for the current task. |
required | object (linker_task_content) Linker task content. |
{- "description": "linker task one",
- "content": {
- "create_list": 1,
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "user_data": "list of good persons",
- "objects_type": "faces",
- "filters": {
- "face_ids": [
- "557d54ec-29ad-4f3c-93b4-c9092ef12515"
], - "external_ids": [
- "14159261415926"
], - "user_data": "info",
- "create_time__gte": "2018-08-11T09:11:41.674Z",
- "create_time__lt": "2018-08-11T09:11:41.674Z",
- "face_id__gte": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "face_id__lt": "string",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "account_id": "string"
}
}
}
{- "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
description | string User data provided for the current task. |
required | object (GcEventsTaskContent) Garbage collecting task content to remove events. |
{- "description": "gc task one",
- "content": {
- "target": "events",
- "filters": {
- "create_time__lt": "string",
- "insert_time__lt": "string",
- "handler_id": "string"
}, - "store_results": true,
- "remove_samples": false,
- "remove_image_origins": 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
description | string User data provided for the current task. |
required | object (CrossMatchTaskContent) Cross match task content. |
{- "description": "matching visitors with the list of VIP customers",
- "content": {
- "filters": {
- "reference_type": "events",
- "candidate_type": "faces",
- "reference_filters": {
- "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",
- "list_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515"
}
}, - "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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.
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
description | string User data provided for the current task. |
required | object (roc_task_content) ROC-curve calculating task content. |
{- "description": "matching famous people with customers",
- "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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:
ZIP archive
S3-like storage
Network disk
FTP server
WARNING: Check handler
storage_policy
before a task start,notification_policy
andevent_policy
enable 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. |
Content-Type | string Value: "application/json" Content type is |
Luna-Account-Id required | 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. 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, request to sdk resource and getting events statistics requests). |
description | string Provided user data for current task. |
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",
- "authorization": {
- "password": 123456
}, - "image_type": 1
}
}
}
{- "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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Get tasks according to the filters.
page | integer >= 1 Default: 1 Page number. | ||||||||||||||||||||||
page_size | integer [ 1 .. 100 ] Default: 10 Number of items on page. | ||||||||||||||||||||||
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 <comma-separate task ids> (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 Example: task_type=1 Task type.
| ||||||||||||||||||||||
task_status | integer (taskStatus) Enum: 0 1 2 3 4 5 Example: task_status=1 Task status.
|
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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]... 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-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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"
}, - {
- "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": {
- "objects_type": "events",
- "threshold": 0.61,
- "params": {
- "use_track_info": 1
}, - "descriptor": {
- "type": "face"
}
}, - "description": "task description"
}
]
}
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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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 <comma-separate task ids> (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 Example: task_type=1 Task type.
| ||||||||||||||||||||||
task_status | integer (taskStatus) Enum: 0 1 2 3 4 5 Example: task_status=1 Task status.
|
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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]... 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-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Get task by ID.
task_id required | integer >= 1 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]... 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-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": {
- "objects_type": "faces",
- "user_data": "some info",
- "list_id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
- "create_list": 1
}, - "description": "task description"
}
Cancel task by ID.
task_id required | integer >= 1 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 >= 1 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 required | 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. 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, request to sdk resource and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 >= 1 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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 >= 1 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 >= 1 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Get subtasks of a task by ID.
task_id required | integer >= 1 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 >= 1 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Get errors of a task by the task ID.
task_id required | integer >= 1 Task ID. |
page | integer >= 1 Default: 1 Page number. |
page_size | integer [ 1 .. 100 ] Default: 10 Number of items on page. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 >= 1 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Get errors according to the filters.
page | integer >= 1 Default: 1 Page number. | ||||||||||||||||||||||
page_size | integer [ 1 .. 100 ] Default: 10 Number of items on page. | ||||||||||||||||||||||
task_ids | string <comma-separate task ids> (taskIds) Example: task_ids=1,2,3 Comma-separated task IDs. | ||||||||||||||||||||||
error_code | integer (error_code) Error code. | ||||||||||||||||||||||
error_ids | string <comma-separate task ids> (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 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Count errors according to the filters.
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 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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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]... 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 = { "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
Create new verifier.
The verifier determinates 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 required | 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. 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, request to sdk resource 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.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": [ ],
- "estimate_liveness": {
- "estimate": 0,
- "liveness_threshold": 0,
- "quality_threshold": 0
}, - "liveness_states": [ ],
- "face_quality": {
- "estimate": 0,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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": 91.1,
- "max": 92.2
}
}, - "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": 0
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "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
}, - "red_eyes": {
- "estimate": 1,
- "threshold": 0
}, - "radial_distortion": {
- "estimate": 1,
- "threshold": 0
}, - "illumination_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}
}
}
}, - "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.
description | string Records with descriptions similar to this parameter will be processed. |
page | integer >= 1 Default: 1 Page number. |
page_size | integer [ 1 .. 100 ] Default: 10 Number of items on page. |
Luna-Request-Id | string^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a External request id. Helps to uniquely identify messages in system logs that correspond to particular 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]... 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-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} 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 } } } } # 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
], - "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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.3,
- "max": 0.9
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 91.1,
- "max": 92.2
}
}, - "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": 100
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "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.4,
- "max": 0.9
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.4,
- "max": 0.9
}
}
}
}
}, - "extract_policy": {
- "extract_basic_attributes": 1,
- "fd_score_threshold": 0.7
}, - "storage_policy": {
- "attribute_policy": {
- "store_attribute": 0
}, - "face_sample_policy": {
- "store_sample": 0
}
}
}, - "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,
- "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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.3,
- "max": 0.9
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 91.1,
- "max": 92.2
}
}, - "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": 100
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "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.4,
- "max": 0.9
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.4,
- "max": 0.9
}
}
}
}
}, - "extract_policy": {
- "extract_basic_attributes": 0,
- "fd_score_threshold": 0
}, - "storage_policy": {
- "attribute_policy": {
- "store_attribute": 0
}, - "face_sample_policy": {
- "store_sample": 0
}
}, - "verification_threshold": 0.9
}, - "version": 0
}
]
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 required | 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. 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, request to sdk resource 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
}
]
}
]
}
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.
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 | string <list of uuid> Example: face_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of face IDs. |
event_ids | string <list of uuid.> Example: event_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of event IDs. |
attribute_ids | string <list of uuid> Example: attribute_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of attribute IDs. |
external_ids | string Example: external_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of external IDs. |
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 required | 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. 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, request to sdk resource 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": [ ]
}
}
}
]
}
Count verifiers that satisfy the filters.
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]... 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 = {"Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} 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 } } } } # 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 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]... 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-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} 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 } } } } # 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
], - "face_quality": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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.3,
- "max": 0.9
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 91.1,
- "max": 92.2
}
}, - "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": 100
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "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.1,
- "max": 0.9
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.1,
- "max": 0.9
}
}
}
}
}, - "extract_policy": {
- "extract_basic_attributes": 1,
- "fd_score_threshold": 0.7
}, - "storage_policy": {
- "attribute_policy": {
- "store_attribute": 0
}, - "face_sample_policy": {
- "store_sample": 0
}
}
}, - "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 required | 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. 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, request to sdk resource 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.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": [ ],
- "estimate_liveness": {
- "estimate": 0,
- "liveness_threshold": 0,
- "quality_threshold": 0
}, - "liveness_states": [ ],
- "face_quality": {
- "estimate": 0,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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": 91.1,
- "max": 92.2
}
}, - "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": 0
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 0
}
}, - "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
}, - "red_eyes": {
- "estimate": 1,
- "threshold": 0
}, - "radial_distortion": {
- "estimate": 1,
- "threshold": 0
}, - "illumination_uniformity": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.5,
- "max": 1
}
}
}
}
}, - "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]... 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-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} 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 } } } } # 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)
{- "error_code": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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 required | 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. 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, request to sdk resource and getting events statistics requests). |
# This example is written using requests library import requests baseUri = "http://127.0.0.1:5000/6" headers = {"Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"} 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 } } } } # 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'"
}
sources | string Example: sources=cam1,cam2 Comma-separated list of sources. Each event from result will contain one of given sources. | ||||||||||||||||
matching_candidates_labels | string 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 | string <list of integer (1, 2, 3, 4)> Example: ethnic_groups=1,2 Comma-separated list of dominant ethnic groups. Each event from result will contain one of given ethnic groups.
| ||||||||||||||||
liveness | string <list of integer (0, 1 ,2)> Example: liveness=1,2 Comma-separated list of dominant liveness. Each event from result will contain one of given liveness.
| ||||||||||||||||
tags | Array of strings (tag) >= 0 items 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. | ||||||||||||||||
cities | string Example: cities=Moscow,New York Comma-separated list of cities. Each event from result will contain one of given cities in "location" parameter. | ||||||||||||||||
areas | string Example: areas=CAD,Manhattan Comma-separated list of areas. Each event from result will contain one of given areas in "location" parameter. | ||||||||||||||||
districts | string Example: districts=Mitino,Midtown Comma-separated list of districts. Each event from result will contain one of given districts in "location" parameter. | ||||||||||||||||
streets | string 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 | string 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 | string <list of uuid.> Example: handler_ids=8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381 Comma-separated list of handler IDs. | ||||||||||||||||
masks | string <list of integer (1, 2, 3)> Example: masks=1,2,3 Comma-separated list of predominant mask states. Each event from result will contain one of given mask states.
| ||||||||||||||||
emotions | string <list of integer (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 given emotions.
|
Luna-Account-Id required | 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. 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, request to sdk resource 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, accountId="8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a") 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",
- "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": 0.7361597418785095,
- "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
}
}, - "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": {
- "estimate": 1,
- "filter": 0,
- "checks": {
- "image_format": {
- "estimate": 1,
- "threshold": [
- "JPEG",
- "JPEG2000",
- "PNG"
]
}, - "illumination_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "specularity_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "blurriness_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "dark_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "light_quality": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_roll": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_yaw": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "gaze_pitch": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_smiling": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_occluded": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "mouth_open": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "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.3,
- "max": 0.9
}
}, - "head_vertical_center": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_width": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "head_height": {
- "estimate": 1,
- "threshold": {
- "min": 0.3,
- "max": 0.9
}
}, - "eye_distance": {
- "estimate": 1,
- "threshold": {
- "min": 91.1,
- "max": 92.2
}
}, - "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": 100
}
}, - "indent_left": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_right": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_upper": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "indent_lower": {
- "estimate": 1,
- "threshold": {
- "min": 20,
- "max": 100
}
}, - "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.1,
- "max": 0.9
}
}, - "dynamic_range": {
- "estimate": 1,
- "threshold": {
- "min": 0.1,
- "max": 0.9
}
}
}
}
}, - "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
}
}, - "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"
}
], - "aggregate_estimations": {
- "face": {
- "attributes": {
- "liveness": {
- "prediction": "spoof",
- "estimations": {
- "quality": 0.7361597418785095,
- "score": 0.600364089012146
}
}, - "mask": {
- "estimations": {
- "medical_mask": 0.020060448,
- "missing": 0.3235525191,
- "occluded": 0.6563870311
}, - "predominant_mask": "occluded"
}, - "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"
}
}
}
}, - "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"
}
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.
Liveness V1 or Liveness V2 can be used for this resource. Liveness V2 does not use "meta" section of the request.
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]... 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) 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 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": 0.95
}
}, - "error": {
- "desc": "Success",
- "detail": "Success",
- "error_code": 0
}
}, - {
- "filename": "succeeded_image_2.jpg",
- "status": 1,
- "liveness": {
- "prediction": 1,
- "estimations": {
- "probability": 0.85,
- "quality": 0.88
}
}, - "error": {
- "desc": "Success",
- "detail": "Success",
- "error_code": 0
}
}, - {
- "filename": "failed_image.jpg",
- "status": 0,
- "liveness": null,
- "error": {
- "desc": "Failed to decode image data",
- "detail": "Failed to decodeImage image data.",
- "error_code": 3001
}
}
], - "aggregate_estimations": {
- "liveness": {
- "prediction": 1,
- "estimations": {
- "probability": 0.89,
- "quality": 0.915
}
}
}
}
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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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": 37003,
- "desc": "Payload too large",
- "detail": "Request payload is too large"
}
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", "Luna-Account-Id": "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a", } 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 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 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
}