Skip to content

Performing Online OneShotLiveness estimation#

You can automatically perform Online OneShotLiveness estimation by sending a request to the LUNA PLATFORM 5 /liveness endpoint. The estimation allows you 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.

To perform Online 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 Online OneShotLiveness estimation:

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