# FaceStream version 5.1.1

### Introduction

This document describes FaceStream backend service API. The service is capable of:

- getting current streams,
- providing streams preview.

Refer to `streams` API for details on how to get stream params.

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 get information about processing streams.

It is also possible to request a video preview for the particular stream. Refer to `streams/preview/` API for details.

#### /streams get

get

Get list of current stream parameters.

#### 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'

  - ffmpeg_threads_number: (integer)

    number of threads for video decoding, by default 0 - choosen by decoder library

- 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)

  - luna_human_handler_id: (string)

    Luna human event handler ID (for Luna API version 6 or higher)

  - luna_dynamic_human_handler_id: (string)

    Luna human detections handler ID (for Luna API version 6 or higher)

  - image_store_url: (string)

    URL of LUNA IMAGE STORE to send frames

- location: (object)

  stream source location parameters

  - send_location_data: (boolean)

    set whether to send location data to LUNA PLATFORM or not, by default false

  - city: (string - maxLength: 36)

    city where event is incidented

  - area: (string - maxLength: 36)

    area where event is incidented

  - district: (string - maxLength: 36)

    district where event is incidented

  - street: (string - maxLength: 36)

    street where event is incidented

  - house_number: (string - maxLength: 36)

    house number where event is incidented

  - geo_position: (object)

    geo position specified by geographic coordinates - longitude and latitude

    - longitude: required(number - minimum: -180 - maximum: 180)

      longitude in degrees

    - latitude: required(number - minimum: -90 - maximum: 90)

      latitude in degrees

- 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

- 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.

- 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.

  - send_each_frames: (integer)

    This parameter enables to send bestshots and detections every N processed frames.

  - send_each_milliseconds: (integer)

    This parameter enables to send bestshots and detections every N milliseconds.

  - send_only_full_set: (boolean)

    This parameter enables to send data only if the required amount of data is available.

  - delete_track_after_sending: (boolean)

    This parameter enables to delete track after sending.

- 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.

- 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.0, 0.25, 0.75].

  - mask_backgrounds_count: (integer)

    the number of background frames that are used for the corresponding checks, by default 300.

- 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)

- 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",
          "luna_human_handler_id": "3b67aad3-12d4-47c3-b8af-6039e70eb74d",
          "luna_dynamic_human_handler_id": "cd6f6705-baea-43cf-a293-5b782878cfb6",
          "image_store_url": "http://10.0.25.227:5000/3/buckets/video_id_0/images/"
        },
        "location": {
          "send_location_data": true,
          "city": "Moscow",
          "area": "CAO",
          "district": "Arbat",
          "street": "Arbat",
          "house_number": "37",
          "geo_position": {
            "longitude": 36.616,
            "latitude": 55.752
          }
        },
        "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,
          "send_each_frames": 0,
          "send_each_milliseconds": 0,
          "send_only_full_set": true,
          "delete_track_after_sending": true
        },
        "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,
            0.25,
            0.75
          ],
          "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",
          "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,
          "send_each_frames": 0,
          "send_each_milliseconds": 0,
          "send_only_full_set": true,
          "delete_track_after_sending": true
        },
        "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,
            0.25,
            0.75
          ],
          "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"
    }

#### /streams/{id} get

get

Get stream info.

#### 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'

  - ffmpeg_threads_number: (integer)

    number of threads for video decoding, by default 0 - choosen by decoder library

- 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)

  - luna_human_handler_id: (string)

    Luna human event handler ID (for Luna API version 6 or higher)

  - luna_dynamic_human_handler_id: (string)

    Luna human detections handler ID (for Luna API version 6 or higher)

  - image_store_url: (string)

    URL of LUNA IMAGE STORE to send frames

- location: (object)

  stream source location parameters

  - send_location_data: (boolean)

    set whether to send location data to LUNA PLATFORM or not, by default false

  - city: (string - maxLength: 36)

    city where event is incidented

  - area: (string - maxLength: 36)

    area where event is incidented

  - district: (string - maxLength: 36)

    district where event is incidented

  - street: (string - maxLength: 36)

    street where event is incidented

  - house_number: (string - maxLength: 36)

    house number where event is incidented

  - geo_position: (object)

    geo position specified by geographic coordinates - longitude and latitude

    - longitude: required(number - minimum: -180 - maximum: 180)

      longitude in degrees

    - latitude: required(number - minimum: -90 - maximum: 90)

      latitude in degrees

- 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

- 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.

- 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.

  - send_each_frames: (integer)

    This parameter enables to send bestshots and detections every N processed frames.

  - send_each_milliseconds: (integer)

    This parameter enables to send bestshots and detections every N milliseconds.

  - send_only_full_set: (boolean)

    This parameter enables to send data only if the required amount of data is available.

  - delete_track_after_sending: (boolean)

    This parameter enables to delete track after sending.

- 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.

- 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.0, 0.25, 0.75].

  - mask_backgrounds_count: (integer)

    the number of background frames that are used for the corresponding checks, by default 300.

- 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)

- 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",
        "luna_human_handler_id": "3b67aad3-12d4-47c3-b8af-6039e70eb74d",
        "luna_dynamic_human_handler_id": "cd6f6705-baea-43cf-a293-5b782878cfb6",
        "image_store_url": "http://10.0.25.227:5000/3/buckets/video_id_0/images/"
      },
      "location": {
        "send_location_data": true,
        "city": "Moscow",
        "area": "CAO",
        "district": "Arbat",
        "street": "Arbat",
        "house_number": "37",
        "geo_position": {
          "longitude": 36.616,
          "latitude": 55.752
        }
      },
      "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,
        "send_each_frames": 0,
        "send_each_milliseconds": 0,
        "send_only_full_set": true,
        "delete_track_after_sending": true
      },
      "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,
          0.25,
          0.75
        ],
        "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 404

Stream not found.

### Body

Media type: application/json

Type: any

Example:

    {
      "error_code": 1,
      "detail": "Stream with such uuid doesn't exist"
    }

## HTTP status code 500

Internal error.

### Body

Media type: application/json

Type: any

Example:

    {
      "error_code": 2,
      "detail": "Unhandled exception"
    }

#### /streams/preview/{id} get

get

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 404

Stream not found.

### Body

Media type: application/json

Type: any

Example:

    {
      "error_code": 1,
      "detail": "Stream with such uuid doesn't exist"
    }

## HTTP status code 500

Internal error.

### Body

Media type: application/json

Type: any

Example:

    {
      "error_code": 2,
      "detail": "Unhandled exception"
    }

#### /streams/preview/frame/{id} get

get

Gets stream last frame as image/jpeg.

#### get /streams/preview/frame/{id}

Gets stream last frame as image/jpeg.

### 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

## 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 404

Stream not found.

### Body

Media type: application/json

Type: any

Example:

    {
      "error_code": 1,
      "detail": "Stream with such uuid doesn't exist"
    }

## HTTP status code 500

Internal error.

### Body

Media type: application/json

Type: any

Example:

    {
      "error_code": 2,
      "detail": "Failed to encode frame to jpeg"
    }

### /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)

#### /metrics get

get

Allows clents to obtain metrics about streams.

#### get /metrics

Allows clents to obtain metrics about streams.

## HTTP status code 200

Ok.

### Body

Media type: text/plain

Type: any

## HTTP status code 500

Internal error.

### Body

Media type: application/json

Type: any

Example:

    {
      "error_code": 2,
      "detail": "Unhandled exception"
    }

### /version

Reciving version information about FaceStream.

#### /version get

get

Reciving version information about FaceStream.

#### get /version

Reciving version information about FaceStream.

## HTTP status code 200

Ok.

### Body

Media type: application/json

Type: any

Example:

    {
      "FaceStream": {
        "api": 1,
        "major": 5,
        "minor": 0,
        "patch": 6
      }
    }