Skip to content

Service setting#

Configure Selinux and Firewall so that they do not block the service.

Navigate to the /lunapassapi directory:

cd /var/lib/luna-pass/current/lunapassapi

In the configuration files lunapassapi.config.toml, lunapassvideo.config.toml, lunapassvideo.task.py, make the necessary settings corresponding to the actual parameters (Table 12).

Table 12. LUNA PASS configuration parameters

Parameter

Description

LUNA PASS configuration parameters

env

Mode:

  • development — debug mode with all data;

  • production — basic operation mode with sensitive data hiding.

For more information see the "Logging and debugging" section

Default: production

host

IP address where the service will be launched.

Default: 0.0.0.0

port

Port on which the service will be launched.

Default: 8321

logLevel

Logging level.

Available values:

  • 0 — error logging;

  • 1 — logging of errors and information messages;

  • 2 — logging of errors, informational messages and debugging information.

Default: 1

logFile

Logging file

Default: -

FACEENGINE configuration parameters

sdkBindingsPath

Path to Python bindings.

Default: /fsdk/pythonBindings/build

sdkDataPath

Path to data directory

Default: /fsdk/data

sdkLicensePath

Path to the license file.

Default: /fsdk/data/license.conf

Configuration parameters LUNA_PASS.JWT

algorithm

Successful frame encryption algorithm.

Default: HS256

key

Successful frame encryption secret.

Default: secret

LIVENESS configuration parameters

maxAttempts

Maximum number of frames received within 1 session.

If the value is exceeded, the current frame is sent as is and the connection is terminated.

If no value is present, the frames are checked until there is a successfully passed Liveness

Default: -1

maxLivenessAttempts

The maximum number of frames that have reached the Liveness estimation.

If the value is exceeded, the current frame is sent as is and the connection is terminated.

If no value is present, the frames are checked until there is a successfully passed Liveness

Default: -1

LIVENESS.THRESHOLDS estimation thresholds

blur

Photo blurring

Default: 0.61

light

Backlighting of the photo image

Default: 0.57

dark

Darkening of the photo image

Default: 0.5

illumination

Image illumination uniformity, 0 – равномерно, 1 – есть пересветы

Default: 0.1

specularity

Glare on the image, 0 – бликов нет, 1 – есть блики.

Default: 0.1

ags

Predictive estimation of whether an incoming image is suitable for further comparing

Default: 0.8

Frame parameters (frame to face ratio)

frameMargin

Indentation from frame borders

Default: 10

Face parameters

faceWidth

Face frame width

Default: 200

faceHeight

Face frame height

Default: 200

yaw

Rotation around the vertical axis of the head

Default: 20

pitch

Rotation around the transverse axis of the head

Default: 20

roll

Rotation around the longitudinal axis of the head

Default: 20

mouth

Required accuracy of mouth status assessment

Default: 0.4

glasses

Availability of glasses. Available values:

  • GlassesEstimation.NoGlasses — no glasses;

  • GlassesEstimation.EyeGlasses — glasses;

  • GlassesEstimation.SunGlasses — sunglasses.

Default: ['GlassesEstimation.NoGlasses', 'GlassesEstimation.EyeGlasses']

deepfake

Required accuracy of the Deepfake estimation. Comment out the line the corresponding threshold to disable checking

Default: 0.5

livenessScore

Thresholds for the OneShot Liveness test result at which a person will be considered «alive»

Default: 0.5

livenessQualityScore

Liveness quality score threshold

Default: 0.5

multifacePolicy

Policy for selecting a person to check Liveness. Available values:

  • 0—only one face from the frame is permitted to send;

  • 1—the largest face in the frame is sent;

  • 2—the face closest to the center in the frame is sent;

Default: 0

Configuration options for query plugins

MIDDLEWARES.REQUEST.BasicAuth plugin

isEnabled

BASIC authorization

Default: 0

args.username

Login for Basic Auth

Default: -

args.password

Password for Basic Auth

Default: -

args.origin

ORIGIN header to protect against Cross-Site WebSocket Hijacking.

Can represent the ip address of the server when accessed by ip address or the domain when accessed by domain name

Default: -

MIDDLEWARES.WS.FaceMatcher plugin

isEnabled

This feature increases resource consumption and may result in poor performance.

Number of faces allowed per session:

  • 0–the main person can be changed within the session;

  • 1–only one main person is allowed per session (depending on multifacePolicy). If the main person changes, the session is terminated;

Default: 0

args.similarity

Similarity threshold. If the similarity value is below the threshold, then it is considered that the frames have different faces and the session is terminated

Default: 0.85

MIDDLEWARES.WS.VirtualCameraChecker plugin

isEnabled

Check frames for use of a virtual camera Default: 0

MIDDLEWARES.WS.FileLogger plugin

isEnabled

Saves all incoming photos and the results of their estimation within one session to a file

Default: 0

args.path

Path for saving file logs

Default: './LOGS'

MIDDLEWARES.WS.Bestshot plugin

isEnabled

Selection of the bestshot according to liveness estimation from those sent for estimation.

Only a frame that has reached the Liveness estimation and with a Liveness quality score higher than LIVENESS.THRESHOLDS.livenessQualityScore can be used as the bestshot

Default: 0

MIDDLEWARES.WS.Luna3DescriptorQualityCheck plugin

isEnabled

Checking the quality of the photo with a given threshold in the external system LUNA PLATFORM version 3.

This plugin should be placed after the bestshot plugin if it is used

Default: 0

args.connectionString

Connection address to LUNA3 API

Default: <http://127.0.0.1:5000>

args.authToken

Authorization token to execute the request

Default: -

args.descriptor QualityThreshold

Descriptor quality threshold

Default: -

MIDDLEWARES.WS.AggregateLiveness plugin

isEnabled

Aggregation of Liveness by N frames

Default: 0

args.framesCount

Number of frames to be aggregated

Default: 3

Plugin MIDDLEWARES.WS.ActiveLiveness

isEnabled

Active Liveness

Default: 0

args.cooldownFramesCount

Minimum number of frames after passing active Liveness

Default: 0

args.interactionsCount

Number of user interactions used, maximum 5

Default: 2

args.acceptOneEyed

Allow user interaction with one eye to blink

Default: 0

args.yawStartDeg

Initial angle of rotation at which it is possible to begin interaction with head turns

Default: 10

args.yawThresholdDeg

Threshold angle of rotation at which interaction on head turns is considered completed

Default: 20

args.pitchStartDeg

The initial head tilt angle at which it is possible to begin head tilt interaction

Default: 10

args.pitchThresholdDeg

The head tilt angle threshold at which the head tilt interaction is considered completed

Default: 20

MIDDLEWARES.WS.Result plugin

isEnabled

Result plugin, used when bestshot, aggregate_liveness, luna3_descriptor_quality_check or a combination of these are enabled.

Based on data from other plugins, decides on the result of Liveness.

For correct operation, the following settings and plugins may be required:

  • MIDDLEWARES.WS.aggregate_liveness.framesCount — with aggregate_liveness plugin enabled;

  • LUNA_PASS.maxLivenessAttempts — when there is a limit on the number of Liveness frames reaching the estimation stage.

Default: 1

MIDDLEWARES.WS.VideoRedis

isEnabled

Plugin for sending session frames to Redis

Default: 0

args.connectionString

Redis connection string

Default: redis://127.0.0.1:6379

args.queueName

Redis queue name for working with video

Default: default

args.resultTtl

How long does Redis store information about the success of tasks and their results

Default:500s

args.failureTtl

How long Redis stores information about unsuccessful tasks

Default: 1y

args.sessionTimeout

Number of seconds to start building video after session termination if no bestshot is available

Default: 300

args.workerTask

The name of the task that lunapassworker will run when it receives a task to build a video

Default: task.run

args.framesLimit

Limit the maximum number of frames in a video.

  • If the value is 0, the restriction is not applied.

  • For values greater than 0, the last N frames are taken for the video

Default: 0