FaceStream version 4.1.0
Introduction
This document describes FaceStream backend service API. The service is capable of:
- creating/deleting/patching streams from camera,
- getting current streams,
- providing streams preview.
Refer to streams
API for details on how to create, delete, patch stream.
Refer to streams/preview
API for details on how to get stream preview.
Refer to metrics
API for details on how to get streams metrics.
API Versioning
All URLs must be prefixed with API version like so: http://127.0.0.1:34569/api/1
.
/streams
Stream API allows clients to create new video streams from cameras with parameters.
After a JSON with array of parameters is submitted, server tries to create corresponding streams. If http query or JSON are invalid, the server responds with error description (HTTP status 400).
In case of internal error, the server responds with error description (HTTP status 500).
If error occurs for one stream, no streams will be created. As streams are created successfully, the client can query information about them.
It is also possible to request a video preview for the particular stream. Refer to streams/preview/
API for details.
Create streams from cameras with parameters. Returns array of streams UUIDs.
Get list of current stream parameters.
Delete streams.
post /streams
Create streams from cameras with parameters. Returns array of streams UUIDs.
Body
Media type: application/json
Type: array of object
Items: stream_params
- name: (string)
display name, by default ""
- input: required(object)
stream input parameters
- url: required(string)
camera address, e.g.
- transport: (one of tcp, udp)
transport protocol for rtsp camera, by default "tcp"
- roi: (array of integer)
region of interest of camera frame (left, top, width, height), by default [0 0 0 0] - full frame
- rotation: (integer)
angle of camera frame rotation, possible values are 0, 90, 180, 270, by default 0
- frame-processing-mode: (one of auto, full, scale)
Determines whether full or scaled frame will be processed, by default "auto" - depends on fs3Config param 'convertFullFrame'
- numberOfFfmpegThreads: (integer)
number of threads for video decoding, by default 0 - choosen by decoder library
- url: required(string)
- output: required(object)
stream output parameters
- url: required(string)
URL of handler in LUNA PLATFORM or FaceStreamManager
- luna-account-id: (string)
Luna-account-Id header value in LUNA PLATFORM (for Luna API version 5 or higher)
- token: (string)
UUID token for authorization in LUNA PLATFORM
- login: (string)
login for authorization in LUNA PLATFORM
- password: (string)
password for authorization in LUNA PLATFORM
- image_store_url: (string)
URL of LUNA IMAGE STORE to send frames
- url: required(string)
- health_check: (object)
stream health check parameters
- max_error_count: (integer)
error count limit in period to consider stream to be alive, by default 10
- period: (integer)
see description of max_error_count, measured in seconds, by default 3600
- retry_delay: (integer)
time gap (in seconds) between attempts to reopen not alive stream, by default 5
- max_error_count: (integer)
- filtering: (object)
stream filtering parameters
- min-score: (number)
score that defines detection quality, threshold for filtering detections sent to the server, by default 0.5187.
- detection-yaw-threshold: (integer)
sets the maximum value of head yaw angle in relation to camera, by default 40.
- detection-pitch-threshold: (integer)
sets the maximum value of head pitch angle in relation to camera, by default 40.
- detection-roll-threshold: (integer)
sets the maximum value of head roll angle in relation to camera, by default 30.
- yaw-number: (integer)
defines the number of frames for image filtration based on head tilt angle, by default 1.
- yaw-collection-mode: (boolean)
sets the number of frames the system must collect to analyze head yaw angle, by default false.
- mouth-occlusion-threshold: (number)
determines how much the mouth can be obscured in the frame, by default 0.0.
- min-score: (number)
- sending: (object)
stream sending parameters
- time-period-of-searching: (integer)
interval in track after the end of which a best shot is sent to the server, by default -1.
- silent-period: (integer)
interval between period. Once the analysis period is over, the system holds this silent-period before starting next period of frame analysis, by default -1.
- type: (string)
sets the measurement metric for analysis periods and intervals between those (per frames or per seconds), by default "sec".
- number-of-bestshots-to-send: (integer)
number of frames that the user sets to receive from the track or certain periods of this track, by default 1.
- time-period-of-searching: (integer)
- primary_track_policy: (object)
stream primary track policy parameters
- use_primary_track_policy: (boolean)
is used in cases of Access Control Systems (turnstiles/gates at the office/bank entrances) for easier control and face recognition implementation in a secured area, by default false.
- best_shot_min_size: (integer)
sets a minimal size for detections within Primary Track policy, by default 70.
- best_shot_proper_size: (integer)
sets the size of detection for Primary Track policy. When a detection reaches the defined value, track immediately sends all its best shots to the server, by default 140.
- use_primary_track_policy: (boolean)
- liveness: (object)
stream liveness parameters
- use_shoulders_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on the head and shoulder areas, by default false.
- use_mask_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on backgrounds, by default false.
- use_flying_faces_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on the facial surrounding, by default false.
- liveness_mode: (integer)
enables to specify which frames from a track will undergo Liveness check. There are three options for selecting a frame
- number_of_liveness_checks: (integer)
enables to specify the number of frames to check for Liveness. The specified value is used in the liveness-mode parameter. By default 10.
- liveness_threshold: (number)
is used to define the presence of a real person in a frame. The system confirms that it is a real person in the frame, and not a photo, only if Liveness returned a value higher than the one specified in the parameter. By default 0.8.
- livenesses_weights: (array of any)
determines the involvement of each liveness check type (shoulders, mask, and flying_faces) in the resulting estimation of the presence of a human face in the frame. By default [0.05, 0.45, 0.5].
- mask_backgrounds_count: (integer)
the number of background frames that are used for the corresponding checks, by default 300.
- use_shoulders_liveness_filtration: (boolean)
Example:
[
{
"name": "Stream 1",
"input": {
"url": "rtsp://10.0.7.100:554",
"transport": "tcp",
"roi": [
10,
15,
470,
625
],
"rotation": 90
},
"output": {
"url": "http://10.0.25.227:5000/3/matching/search?list_id=80eadf6c-f7f1-4f92-95f9-7caf0e30d3d0",
"luna-account-id": "62a28f5c-cb84-44c8-8f3b-045e562c88bc",
"token": "608d1016-2975-45a2-93fb-047a1389bc68",
"login": "login",
"password": "password",
"image_store_url": "http://10.0.25.227:5000/3/buckets/video_id_0/images/"
},
"health_check": {
"max_error_count": 10,
"period": 2000,
"retry_delay": 10
},
"filtering": {
"min-score": 0.5187,
"detection-yaw-threshold": 40,
"detection-pitch-threshold": 40,
"detection-roll-threshold": 30,
"yaw-number": 1,
"yaw-collection-mode": false,
"mouth-occlusion-threshold": 0
},
"sending": {
"time-period-of-searching": -1,
"silent-period": 0,
"type": "sec",
"number-of-bestshots-to-send": 1
},
"primary_track_policy": {
"use_primary_track_policy": false,
"best_shot_min_size": 70,
"best_shot_proper_size": 140
},
"liveness": {
"use_shoulders_liveness_filtration": false,
"use_mask_liveness_filtration": false,
"use_flying_faces_liveness_filtration": false,
"liveness_mode": 1,
"number_of_liveness_checks": 10,
"liveness_threshold": 0.8,
"livenesses_weights": [
0.05,
0.45,
0.5
],
"mask_backgrounds_count": 300
}
}
]
HTTP status code 201
Body
Media type: application/json
Type: any
Example:
[
"0e1b48e9-6c80-4986-399c-81f3170aeb34"
]
HTTP status code 400
Invalid query or JSON.
Body
Media type: application/json
Type: any
Example:
{
"error_code": 1,
"detail": "Invalid parameter 'rotation' value '19'."
}
HTTP status code 500
Internal error.
Body
Media type: application/json
Type: any
Example:
{
"error_code": 2,
"detail": "Unhandled exception"
}
get /streams
Get list of current stream parameters.
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: stream_info
- id: required(string)
stream UUID
- name: required(string)
display name
- preview_url: required(string)
stream preview URL
- alive: required(integer)
is stream alive now, possible values are 0, 1
- input: required(object)
stream input parameters
- url: required(string)
camera address, e.g.
- transport: (one of tcp, udp)
transport protocol for rtsp camera, by default "tcp"
- roi: (array of integer)
region of interest of camera frame (left, top, width, height), by default [0 0 0 0] - full frame
- rotation: (integer)
angle of camera frame rotation, possible values are 0, 90, 180, 270, by default 0
- frame-processing-mode: (one of auto, full, scale)
Determines whether full or scaled frame will be processed, by default "auto" - depends on fs3Config param 'convertFullFrame'
- numberOfFfmpegThreads: (integer)
number of threads for video decoding, by default 0 - choosen by decoder library
- url: required(string)
- output: required(object)
stream output parameters
- url: required(string)
URL of handler in LUNA PLATFORM or FaceStreamManager
- luna-account-id: (string)
Luna-account-Id header value in LUNA PLATFORM (for Luna API version 5 or higher)
- token: (string)
UUID token for authorization in LUNA PLATFORM
- login: (string)
login for authorization in LUNA PLATFORM
- password: (string)
password for authorization in LUNA PLATFORM
- image_store_url: (string)
URL of LUNA IMAGE STORE to send frames
- url: required(string)
- health_check: required(object)
stream health check parameters
- max_error_count: (integer)
error count limit in period to consider stream to be alive, by default 10
- period: (integer)
see description of max_error_count, measured in seconds, by default 3600
- retry_delay: (integer)
time gap (in seconds) between attempts to reopen not alive stream, by default 5
- max_error_count: (integer)
- filtering: (object)
stream filtering parameters
- min-score: (number)
score that defines detection quality, threshold for filtering detections sent to the server, by default 0.5187.
- detection-yaw-threshold: (integer)
sets the maximum value of head yaw angle in relation to camera, by default 40.
- detection-pitch-threshold: (integer)
sets the maximum value of head pitch angle in relation to camera, by default 40.
- detection-roll-threshold: (integer)
sets the maximum value of head roll angle in relation to camera, by default 30.
- yaw-number: (integer)
defines the number of frames for image filtration based on head tilt angle, by default 1.
- yaw-collection-mode: (boolean)
sets the number of frames the system must collect to analyze head yaw angle, by default false.
- mouth-occlusion-threshold: (number)
determines how much the mouth can be obscured in the frame, by default 0.0.
- min-score: (number)
- sending: (object)
stream sending parameters
- time-period-of-searching: (integer)
interval in track after the end of which a best shot is sent to the server, by default -1.
- silent-period: (integer)
interval between period. Once the analysis period is over, the system holds this silent-period before starting next period of frame analysis, by default -1.
- type: (string)
sets the measurement metric for analysis periods and intervals between those (per frames or per seconds), by default "sec".
- number-of-bestshots-to-send: (integer)
number of frames that the user sets to receive from the track or certain periods of this track, by default 1.
- time-period-of-searching: (integer)
- primary_track_policy: (object)
stream primary track policy parameters
- use_primary_track_policy: (boolean)
is used in cases of Access Control Systems (turnstiles/gates at the office/bank entrances) for easier control and face recognition implementation in a secured area, by default false.
- best_shot_min_size: (integer)
sets a minimal size for detections within Primary Track policy, by default 70.
- best_shot_proper_size: (integer)
sets the size of detection for Primary Track policy. When a detection reaches the defined value, track immediately sends all its best shots to the server, by default 140.
- use_primary_track_policy: (boolean)
- liveness: (object)
stream liveness parameters
- use_shoulders_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on the head and shoulder areas, by default false.
- use_mask_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on backgrounds, by default false.
- use_flying_faces_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on the facial surrounding, by default false.
- liveness_mode: (integer)
enables to specify which frames from a track will undergo Liveness check. There are three options for selecting a frame
- number_of_liveness_checks: (integer)
enables to specify the number of frames to check for Liveness. The specified value is used in the liveness-mode parameter. By default 10.
- liveness_threshold: (number)
is used to define the presence of a real person in a frame. The system confirms that it is a real person in the frame, and not a photo, only if Liveness returned a value higher than the one specified in the parameter. By default 0.8.
- livenesses_weights: (array of any)
determines the involvement of each liveness check type (shoulders, mask, and flying_faces) in the resulting estimation of the presence of a human face in the frame. By default [0.05, 0.45, 0.5].
- mask_backgrounds_count: (integer)
the number of background frames that are used for the corresponding checks, by default 300.
- use_shoulders_liveness_filtration: (boolean)
- video_info: required(object)
stream source video info
- width: required(integer)
stream source video width
- height: required(integer)
stream source video height
- frame_rate: required(integer)
stream source video frame rate
- bit_rate: required(integer)
stream source video bit rate
- gop_size: required(integer)
stream source video gop size
- start_time: required(string)
stream start time (ISO 8601)
- width: required(integer)
- error: required(string)
stream error text description
- time: required(string)
Time, when error occured
Example:
[
{
"id": "0e1b48e9-6c80-4986-399c-81f3170aeb34",
"name": "Stream 1",
"preview_url": "/api/1/streams/preview/0e1b48e9-6c80-4986-399c-81f3170aeb34",
"alive": 1,
"input": {
"url": "rtsp://10.0.7.100:554",
"transport": "tcp",
"roi": [
0,
0,
500,
500
],
"rotation": 180
},
"output": {
"url": "http://10.0.25.227:5000/3/matching/search?list_id=80eadf6c-f7f1-4f92-95f9-7caf0e30d3d0",
"luna-account-id": "62a28f5c-cb84-44c8-8f3b-045e562c88bc",
"token": "608d1016-2975-45a2-93fb-047a1389bc68",
"login": "login",
"password": "password",
"image_store_url": "http://10.0.25.227:5000/3/buckets/video_id_0/images/"
},
"health_check": {
"max_error_count": 20,
"period": 1000,
"retry_delay": 20
},
"filtering": {
"min-score": 0.5187,
"detection-yaw-threshold": 40,
"detection-pitch-threshold": 40,
"detection-roll-threshold": 30,
"yaw-number": 1,
"yaw-collection-mode": false,
"mouth-occlusion-threshold": 0
},
"sending": {
"time-period-of-searching": -1,
"silent-period": 0,
"type": "sec",
"number-of-bestshots-to-send": 1
},
"primary_track_policy": {
"use_primary_track_policy": false,
"best_shot_min_size": 70,
"best_shot_proper_size": 140
},
"liveness": {
"use_shoulders_liveness_filtration": false,
"use_mask_liveness_filtration": false,
"use_flying_faces_liveness_filtration": false,
"liveness_mode": 1,
"number_of_liveness_checks": 10,
"liveness_threshold": 0.8,
"livenesses_weights": [
0.05,
0.45,
0.5
],
"mask_backgrounds_count": 300
},
"video_info": {
"width": 1920,
"height": 1080,
"frame_rate": 25,
"bit_rate": 0,
"gop_size": 12,
"start_time": "2019-01-17T14:59:58Z"
}
},
{
"id": "4b8920e6-f80d-25a7-5a92-6eeeb9d6b076",
"name": "Stream 2",
"preview_url": "/api/1/streams/preview/0e1b48e9-6c80-4986-399c-81f3170aeb34",
"alive": 1,
"input": {
"url": "rtsp://10.0.7.100:554",
"transport": "tcp",
"roi": [
0,
0,
500,
500
],
"rotation": 180
},
"output": {
"url": "http://10.0.25.227:5000/3/matching/search?list_id=80eadf6c-f7f1-4f92-95f9-7caf0e30d3d0",
"luna-account-id": "62a28f5c-cb84-44c8-8f3b-045e562c88bc",
"token": "608d1016-2975-45a2-93fb-047a1389bc68",
"login": "login",
"password": "password",
"image_store_url": "http://10.0.25.227:5000/3/buckets/video_id_0/images/"
},
"health_check": {
"max_error_count": 20,
"period": 1000,
"retry_delay": 20
},
"filtering": {
"min-score": 0.5187,
"detection-yaw-threshold": 40,
"detection-pitch-threshold": 40,
"detection-roll-threshold": 30,
"yaw-number": 1,
"yaw-collection-mode": false,
"mouth-occlusion-threshold": 0
},
"sending": {
"time-period-of-searching": -1,
"silent-period": 0,
"type": "sec",
"number-of-bestshots-to-send": 1
},
"primary_track_policy": {
"use_primary_track_policy": false,
"best_shot_min_size": 70,
"best_shot_proper_size": 140
},
"liveness": {
"use_shoulders_liveness_filtration": false,
"use_mask_liveness_filtration": false,
"use_flying_faces_liveness_filtration": false,
"liveness_mode": 1,
"number_of_liveness_checks": 10,
"liveness_threshold": 0.8,
"livenesses_weights": [
0.05,
0.45,
0.5
],
"mask_backgrounds_count": 300
},
"video_info": {
"width": 1920,
"height": 1080,
"frame_rate": 25,
"bit_rate": 0,
"gop_size": 12,
"start_time": "2019-01-17T15:03:08Z"
}
}
]
HTTP status code 400
Invalid query.
Body
Media type: application/json
Type: any
Example:
{
"error_code": 1,
"detail": "Any streams are not found"
}
delete /streams
Delete streams.
Body
Media type: application/json
Type: any
Example:
[
"0e1b48e9-6c80-4986-399c-81f3170aeb34",
"ac2fab8c-f995-9f57-0a86-c24ea1746ccf"
]
Change stream parameters.
Get stream info.
Delete one stream.
patch /streams/{id}
Change stream parameters.
URI Parameters
- id: required(string)
Stream ID UUID.
Body
Media type: application/json
Type: object
Properties- name: (string)
display name, by default ""
- input: required(object)
stream input parameters
- url: required(string)
camera address, e.g.
- transport: (one of tcp, udp)
transport protocol for rtsp camera, by default "tcp"
- roi: (array of integer)
region of interest of camera frame (left, top, width, height), by default [0 0 0 0] - full frame
- rotation: (integer)
angle of camera frame rotation, possible values are 0, 90, 180, 270, by default 0
- frame-processing-mode: (one of auto, full, scale)
Determines whether full or scaled frame will be processed, by default "auto" - depends on fs3Config param 'convertFullFrame'
- numberOfFfmpegThreads: (integer)
number of threads for video decoding, by default 0 - choosen by decoder library
- url: required(string)
- output: required(object)
stream output parameters
- url: required(string)
URL of handler in LUNA PLATFORM or FaceStreamManager
- luna-account-id: (string)
Luna-account-Id header value in LUNA PLATFORM (for Luna API version 5 or higher)
- token: (string)
UUID token for authorization in LUNA PLATFORM
- login: (string)
login for authorization in LUNA PLATFORM
- password: (string)
password for authorization in LUNA PLATFORM
- image_store_url: (string)
URL of LUNA IMAGE STORE to send frames
- url: required(string)
- health_check: (object)
stream health check parameters
- max_error_count: (integer)
error count limit in period to consider stream to be alive, by default 10
- period: (integer)
see description of max_error_count, measured in seconds, by default 3600
- retry_delay: (integer)
time gap (in seconds) between attempts to reopen not alive stream, by default 5
- max_error_count: (integer)
- filtering: (object)
stream filtering parameters
- min-score: (number)
score that defines detection quality, threshold for filtering detections sent to the server, by default 0.5187.
- detection-yaw-threshold: (integer)
sets the maximum value of head yaw angle in relation to camera, by default 40.
- detection-pitch-threshold: (integer)
sets the maximum value of head pitch angle in relation to camera, by default 40.
- detection-roll-threshold: (integer)
sets the maximum value of head roll angle in relation to camera, by default 30.
- yaw-number: (integer)
defines the number of frames for image filtration based on head tilt angle, by default 1.
- yaw-collection-mode: (boolean)
sets the number of frames the system must collect to analyze head yaw angle, by default false.
- mouth-occlusion-threshold: (number)
determines how much the mouth can be obscured in the frame, by default 0.0.
- min-score: (number)
- sending: (object)
stream sending parameters
- time-period-of-searching: (integer)
interval in track after the end of which a best shot is sent to the server, by default -1.
- silent-period: (integer)
interval between period. Once the analysis period is over, the system holds this silent-period before starting next period of frame analysis, by default -1.
- type: (string)
sets the measurement metric for analysis periods and intervals between those (per frames or per seconds), by default "sec".
- number-of-bestshots-to-send: (integer)
number of frames that the user sets to receive from the track or certain periods of this track, by default 1.
- time-period-of-searching: (integer)
- primary_track_policy: (object)
stream primary track policy parameters
- use_primary_track_policy: (boolean)
is used in cases of Access Control Systems (turnstiles/gates at the office/bank entrances) for easier control and face recognition implementation in a secured area, by default false.
- best_shot_min_size: (integer)
sets a minimal size for detections within Primary Track policy, by default 70.
- best_shot_proper_size: (integer)
sets the size of detection for Primary Track policy. When a detection reaches the defined value, track immediately sends all its best shots to the server, by default 140.
- use_primary_track_policy: (boolean)
- liveness: (object)
stream liveness parameters
- use_shoulders_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on the head and shoulder areas, by default false.
- use_mask_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on backgrounds, by default false.
- use_flying_faces_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on the facial surrounding, by default false.
- liveness_mode: (integer)
enables to specify which frames from a track will undergo Liveness check. There are three options for selecting a frame
- number_of_liveness_checks: (integer)
enables to specify the number of frames to check for Liveness. The specified value is used in the liveness-mode parameter. By default 10.
- liveness_threshold: (number)
is used to define the presence of a real person in a frame. The system confirms that it is a real person in the frame, and not a photo, only if Liveness returned a value higher than the one specified in the parameter. By default 0.8.
- livenesses_weights: (array of any)
determines the involvement of each liveness check type (shoulders, mask, and flying_faces) in the resulting estimation of the presence of a human face in the frame. By default [0.05, 0.45, 0.5].
- mask_backgrounds_count: (integer)
the number of background frames that are used for the corresponding checks, by default 300.
- use_shoulders_liveness_filtration: (boolean)
Example:
{
"name": "Stream 2",
"input": {
"url": "rtsp://10.0.7.100:554",
"transport": "tcp",
"roi": [
0,
0,
500,
500
],
"rotation": 180
},
"output": {
"url": "http://10.0.25.227:5000/3/matching/search?list_id=80eadf6c-f7f1-4f92-95f9-7caf0e30d3d0",
"luna-account-id": "62a28f5c-cb84-44c8-8f3b-045e562c88bc",
"token": "608d1016-2975-45a2-93fb-047a1389bc68",
"login": "login",
"password": "password",
"image_store_url": "http://10.0.25.227:5000/3/buckets/video_id_0/images/"
},
"health_check": {
"max_error_count": 20,
"period": 1000,
"retry_delay": 20
},
"filtering": {
"min-score": 0.5187,
"detection-yaw-threshold": 40,
"detection-pitch-threshold": 40,
"detection-roll-threshold": 30,
"yaw-number": 1,
"yaw-collection-mode": false,
"mouth-occlusion-threshold": 0
},
"sending": {
"time-period-of-searching": -1,
"silent-period": 0,
"type": "sec",
"number-of-bestshots-to-send": 1
},
"primary_track_policy": {
"use_primary_track_policy": false,
"best_shot_min_size": 70,
"best_shot_proper_size": 140
},
"liveness": {
"use_shoulders_liveness_filtration": false,
"use_mask_liveness_filtration": false,
"use_flying_faces_liveness_filtration": false,
"liveness_mode": 1,
"number_of_liveness_checks": 10,
"liveness_threshold": 0.8,
"livenesses_weights": [
0.05,
0.45,
0.5
],
"mask_backgrounds_count": 300
}
}
get /streams/{id}
Get stream info.
URI Parameters
- id: required(string)
Stream ID UUID.
HTTP status code 200
Ok.
Body
Media type: application/json
Type: object
Properties- id: required(string)
stream UUID
- name: required(string)
display name
- preview_url: required(string)
stream preview URL
- alive: required(integer)
is stream alive now, possible values are 0, 1
- input: required(object)
stream input parameters
- url: required(string)
camera address, e.g.
- transport: (one of tcp, udp)
transport protocol for rtsp camera, by default "tcp"
- roi: (array of integer)
region of interest of camera frame (left, top, width, height), by default [0 0 0 0] - full frame
- rotation: (integer)
angle of camera frame rotation, possible values are 0, 90, 180, 270, by default 0
- frame-processing-mode: (one of auto, full, scale)
Determines whether full or scaled frame will be processed, by default "auto" - depends on fs3Config param 'convertFullFrame'
- numberOfFfmpegThreads: (integer)
number of threads for video decoding, by default 0 - choosen by decoder library
- url: required(string)
- output: required(object)
stream output parameters
- url: required(string)
URL of handler in LUNA PLATFORM or FaceStreamManager
- luna-account-id: (string)
Luna-account-Id header value in LUNA PLATFORM (for Luna API version 5 or higher)
- token: (string)
UUID token for authorization in LUNA PLATFORM
- login: (string)
login for authorization in LUNA PLATFORM
- password: (string)
password for authorization in LUNA PLATFORM
- image_store_url: (string)
URL of LUNA IMAGE STORE to send frames
- url: required(string)
- health_check: required(object)
stream health check parameters
- max_error_count: (integer)
error count limit in period to consider stream to be alive, by default 10
- period: (integer)
see description of max_error_count, measured in seconds, by default 3600
- retry_delay: (integer)
time gap (in seconds) between attempts to reopen not alive stream, by default 5
- max_error_count: (integer)
- filtering: (object)
stream filtering parameters
- min-score: (number)
score that defines detection quality, threshold for filtering detections sent to the server, by default 0.5187.
- detection-yaw-threshold: (integer)
sets the maximum value of head yaw angle in relation to camera, by default 40.
- detection-pitch-threshold: (integer)
sets the maximum value of head pitch angle in relation to camera, by default 40.
- detection-roll-threshold: (integer)
sets the maximum value of head roll angle in relation to camera, by default 30.
- yaw-number: (integer)
defines the number of frames for image filtration based on head tilt angle, by default 1.
- yaw-collection-mode: (boolean)
sets the number of frames the system must collect to analyze head yaw angle, by default false.
- mouth-occlusion-threshold: (number)
determines how much the mouth can be obscured in the frame, by default 0.0.
- min-score: (number)
- sending: (object)
stream sending parameters
- time-period-of-searching: (integer)
interval in track after the end of which a best shot is sent to the server, by default -1.
- silent-period: (integer)
interval between period. Once the analysis period is over, the system holds this silent-period before starting next period of frame analysis, by default -1.
- type: (string)
sets the measurement metric for analysis periods and intervals between those (per frames or per seconds), by default "sec".
- number-of-bestshots-to-send: (integer)
number of frames that the user sets to receive from the track or certain periods of this track, by default 1.
- time-period-of-searching: (integer)
- primary_track_policy: (object)
stream primary track policy parameters
- use_primary_track_policy: (boolean)
is used in cases of Access Control Systems (turnstiles/gates at the office/bank entrances) for easier control and face recognition implementation in a secured area, by default false.
- best_shot_min_size: (integer)
sets a minimal size for detections within Primary Track policy, by default 70.
- best_shot_proper_size: (integer)
sets the size of detection for Primary Track policy. When a detection reaches the defined value, track immediately sends all its best shots to the server, by default 140.
- use_primary_track_policy: (boolean)
- liveness: (object)
stream liveness parameters
- use_shoulders_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on the head and shoulder areas, by default false.
- use_mask_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on backgrounds, by default false.
- use_flying_faces_liveness_filtration: (boolean)
enables checking the presence of a real person in the frame based on the facial surrounding, by default false.
- liveness_mode: (integer)
enables to specify which frames from a track will undergo Liveness check. There are three options for selecting a frame
- number_of_liveness_checks: (integer)
enables to specify the number of frames to check for Liveness. The specified value is used in the liveness-mode parameter. By default 10.
- liveness_threshold: (number)
is used to define the presence of a real person in a frame. The system confirms that it is a real person in the frame, and not a photo, only if Liveness returned a value higher than the one specified in the parameter. By default 0.8.
- livenesses_weights: (array of any)
determines the involvement of each liveness check type (shoulders, mask, and flying_faces) in the resulting estimation of the presence of a human face in the frame. By default [0.05, 0.45, 0.5].
- mask_backgrounds_count: (integer)
the number of background frames that are used for the corresponding checks, by default 300.
- use_shoulders_liveness_filtration: (boolean)
- video_info: required(object)
stream source video info
- width: required(integer)
stream source video width
- height: required(integer)
stream source video height
- frame_rate: required(integer)
stream source video frame rate
- bit_rate: required(integer)
stream source video bit rate
- gop_size: required(integer)
stream source video gop size
- start_time: required(string)
stream start time (ISO 8601)
- width: required(integer)
- error: required(string)
stream error text description
- time: required(string)
Time, when error occured
Example:
{
"id": "0e1b48e9-6c80-4986-399c-81f3170aeb34",
"name": "Stream 2",
"preview_url": "/api/1/streams/preview/0e1b48e9-6c80-4986-399c-81f3170aeb34",
"alive": 1,
"input": {
"url": "rtsp://10.0.7.100:554",
"transport": "tcp",
"roi": [
0,
0,
500,
500
],
"rotation": 180
},
"output": {
"url": "http://10.0.25.227:5000/3/matching/search?list_id=80eadf6c-f7f1-4f92-95f9-7caf0e30d3d0",
"luna-account-id": "62a28f5c-cb84-44c8-8f3b-045e562c88bc",
"token": "608d1016-2975-45a2-93fb-047a1389bc68",
"login": "login",
"password": "password",
"image_store_url": "http://10.0.25.227:5000/3/buckets/video_id_0/images/"
},
"health_check": {
"max_error_count": 20,
"period": 1000,
"retry_delay": 20
},
"filtering": {
"min-score": 0.5187,
"detection-yaw-threshold": 40,
"detection-pitch-threshold": 40,
"detection-roll-threshold": 30,
"yaw-number": 1,
"yaw-collection-mode": false,
"mouth-occlusion-threshold": 0
},
"sending": {
"time-period-of-searching": -1,
"silent-period": 0,
"type": "sec",
"number-of-bestshots-to-send": 1
},
"primary_track_policy": {
"use_primary_track_policy": false,
"best_shot_min_size": 70,
"best_shot_proper_size": 140
},
"liveness": {
"use_shoulders_liveness_filtration": false,
"use_mask_liveness_filtration": false,
"use_flying_faces_liveness_filtration": false,
"liveness_mode": 1,
"number_of_liveness_checks": 10,
"liveness_threshold": 0.8,
"livenesses_weights": [
0.05,
0.45,
0.5
],
"mask_backgrounds_count": 300
},
"original_info": {
"width": 1920,
"height": 1080,
"frame_rate": 25,
"start_time": "Mon Jan 14 17:33:38 2019"
}
}
HTTP status code 400
Invalid query or JSON.
Body
Media type: application/json
Type: any
Example:
{
"error_code": 1,
"detail": "Invalid uuid"
}
HTTP status code 500
Internal error.
Body
Media type: application/json
Type: any
Example:
{
"error_code": 2,
"detail": "Unhandled exception"
}
delete /streams/{id}
Delete one stream.
URI Parameters
- id: required(string)
Stream ID UUID.
Allows clents to obtain stream preview as MotionJPEG: server sends JPEG stream of frames.
get /streams/preview/{id}
Allows clents to obtain stream preview as MotionJPEG: server sends JPEG stream of frames.
URI Parameters
- id: required(string)
Stream UUID.
Query Parameters
- quality: (integer)
JPEG compression level of stream preview image (is in [0, 100] range, values lower than 25 could produce bad visual quality), by default 75
- show_bbox: (integer)
Show tracks and some other info on stream preview (0 or 1), by default 1
- width: (integer)
Max preview width (scaled down if actual width is larger). Image is scaled with proportion saving. If it is equal 0, doesn't affect, by default 0
- height: (integer)
Max preview height (scaled down if actual height is larger). Image is scaled with proportion saving. If it is equal 0, doesn't affect, by default 0
- fps: (integer)
Max translation stream fps. If it is equal 0, doesn't affect, by default 0
HTTP status code 200
Ok.
Body
Media type: image/jpeg
Type: any
Example:
<jpeg image data>
HTTP status code 400
Invalid query or id.
Body
Media type: application/json
Type: any
Example:
{
"error_code": 1,
"detail": "Invalid uuid"
}
HTTP status code 500
Internal error.
Body
Media type: application/json
Type: any
Example:
{
"error_code": 2,
"detail": "Unhandled exception"
}
/metrics
Stream API allows clients to get all metrics about Face Stream's current state, like streams or translations count, errors, etc.
Output format can be obtained from "https://prometheus.io/".
Metrics is subdivided into two sections: global metrics (all streams information) and each stream's metrics.
Global metrics section is started with comment "# Global counters".
Each stream metrics section is started with comment like "# Stream name = 'stream name' uuid = 'stream uuid'".
Global metrics counters:
Create_stream_errors - streams creating errors counter. Tags: "code" (text code of error) and "msg" (description of error)
Streams_count - current streams count. Tags: "all" (all streams count) and "alive" (alive streams count)
Translations_count - current translations count
Streams metrics counters:
Streams_errors - count of errors occurred in attempts to open stream or read frame from it. Tags: "action" (open or read frame), "error" (text code of error), "msg" (description of error)
Skips_count - total frames, that have been skipped (not processed) because of high load
Detections_count - current frame face detections count (in development)
FPS - current FPS (of stream processing)
Allows clents to obtain metrics about streams.