Skip to content

Service configuration#

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

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

By default, logs are written to the console. Enable the logFile parameter to duplicate logs to the 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: 100

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: 75

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

Uniformity of image illumination, 0 – uniform, 1 – there are overexposures

Default: 0.1

specularity

Glare on the image, 0 – no glare, 1 – there are glare

Default: 0.1

ags

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

Default: 0.8

Face parameters

faceWidth

Face frame width

Default: 150

faceHeight

Face frame height

Default: 150

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

livenessScore

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

Default: 0.7

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

LIVENESS.THRESHOLDS.ROI—configuration of the face recognition zone

centerX

The center of the ROI zone along the X axis

Default: 50

The centerXUnit parameter is responsible for the unit of measurement the of the X coordinate. Possible values:

  • percent—measurement in percentage relative to the size of the incoming frame;

  • px—measurement in pixels

Default: percent

centerY

The center of the ROI zone along the Y axis

Default: 50

The centerYUnit parameter is responsible for the unit of measurement of the Y coordinate. Possible values:

  • percent—measurement in percentage relative to the size of the incoming frame;

  • px—measurement in pixels

Default: percent

width

The width of the ROI zone

Default: 90

The widthUnit parameter is responsible for the unit of measurement of the zone width. Possible values:

  • percent—measurement in percentage relative to the size of the incoming frame;

  • px—measurement in pixels

Default: percent

height

Height of the ROI zone

Default: 90

The heightUnit parameter is responsible for the unit of measurement of the zone height. Possible values:

  • percent—measurement in percentage relative to the size of the incoming frame;

  • px—measurement in pixels

Default: percent

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: 1

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: 1

MIDDLEWARES.WS.FileLogger plugin

isEnabled

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

Default: 1

args.path

Path for saving file logs

Default: './LOGS'

MIDDLEWARES.WS.AggregateLiveness plugin

isEnabled

Aggregation of Liveness by N frames

Default: 1

args.framesCount

Number of frames to be aggregated

Default: 5

Plugin MIDDLEWARES.WS.ActiveLiveness

isEnabled

Active Liveness

Default: 1

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

isEnabled

Plugin for sending session frames to Redis

Default: 1

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