Skip to content

Enabling OneShotLiveness estimation#

You can automatically perform the OneShotLiveness estimation, that is to determine if the person in the image is a living person or a photograph. You can then validate the received images with LUNA PLATFORM 5.

In LUNA ID for Android#

To enable the OneShotLiveness estimation:

1․ Specify the livenessType: LivenessType field in LunaConfig. The field accepts one of the following values:

Value Description
None Disables the estimation. The default value.
Online Enables the estimation by sending a request to the LUNA PLATFORM 5 /liveness endpoint.

2․ Specify the required LUNA PLATFORM 5 server parameters in ApiHumanConfig.

The example below shows how to enable the OneShotLiveness estimation:

val apiConfig = ApiHumanConfig("http://luna-platform.com/api/6/")
    LunaID.init(
        ...
        apiHumanConfig = apiConfig,
        lunaConfig = LunaConfig.create(
         livenessType = LivenessType.Online,
        ),
    )

In LUNA ID for iOS#

To enable the OneShotLiveness estimation, you need to pass appropriate values for the livenessAPI and configuration parameters to the camera controller instance creation function LMCameraBuilder.viewController:

let controller = LMCameraBuilder.viewController(delegate: self,
                                                    configuration: LCLunaConfiguration,
                                                    livenessAPI: livenessAPI)
Parameter Description
configuration The parameter is represented by the LCLunaConfiguration structure.
livenessAPI The API should be of type LunaWeb.LivenessAPIv6.

The API accepts the configuration parameter, which contains all the necessary settings for checking liveness.