3.1 SilentLivenessApi

public final class SilentLivenessApi

public static void init(@NonNull final Context context, @NonNull final String licenseFilePath, @NonNull final String detectionModelFilePath, @NonNull final String alignmentModelFilePath, @NonNull final String qualityModelFilePath, @NonNull final String frameSelectorModelFilePath, @NonNull final String antiSpoofingModelFilePath, @NonNull final OnLivenessListener listener)

Initialization method.

public static void setBrowOcclusionEnable(final boolean enable)

Set whether to perform eyebrow occlusion detection during liveness detection, false by default.

public static void setBlurryFilterEnable(final boolean enable, final float threshold)

Set whether to perform blurriness detection during liveness detection, false by default. The threshold is 1.4 by default.

public static void setIlluminationFilterEnable(final boolean enable, final float lowLightThreshold, final float brightThreshold)

Set whether to perform brightness detection during liveness detection, false by default. The low light threshold is 1.899 by default. The bright light threshold is 4.997 by default.

public static void setEyeOpenThreshold(final float threshold)

Set the threshold used to judge the eye-opening during liveness detection.

public static void setOcclusionEnable(final boolean enable)

Set whether to perform occlusion detection during liveness detection, true by default.

public static void setThreshold(final float threshold)

Set the threshold for liveness detection, 0.88 by default.

public static void setDetectTimeout(int timeout)

The maximum detection time allowed for each module, the default value is 10s, the unit is in seconds.

public static void setFaceDistanceRate(float farRate, float closeRate)

Set the judgment condition for the face distance.

public static void inputData(byte[] image, PixelFormat format, Size previewSize, Rect containerRect, boolean frontCameraOrNot, int cameraOrientation)

Liveness detector configuration. Input image for detection.

public static void start()

Ready to start detection. Call before inputData and after init.

public static void release()

Release resources after calling init. The resources must be released through release.

public static void stop()

Stop the current detection, and reset the detection status. This method is used to retry after failure. If stop is called after init succeeded and before release), detection can be restarted directly by start.

public static boolean getBrowOcclusionEnable()

Obtain the setting whether eyebrow occlusion detection switch status. Should be called after init to get the correct result. Otherwise, it will return false, and the correct settings for the eyebrow occlusion cannot be obtained.

public static boolean getBlurryFilterEnable()

Obtain the setting whether blurriness detection switch status. Should be called after init to get the correct result. Otherwise, it will return false, and the correct settings for the blurriness cannot be obtained.

public static boolean getIlluminationFilterEnable()

Obtain the setting whether brightness detection switch status. Should be called after init to get the correct result. Otherwise, it will return false, and the correct settings for the brightness cannot be obtained.

public static boolean getOcclusionEnable()

Obtain the setting whether occlusion detection switch status. Should be called after init to get the correct result. Otherwise, it will return false, and the correct settings for the occlusion cannot be obtained.

public static float getThreshold()

Obtain the threshold of liveness detection. Should be called after init to get the correct result. Otherwise, it will return -1.0.

public static int getDetectTimeout()

Obtain the detection timeout time. Should be called after init to get the correct result. Otherwise, it will return -1, indicating that the correct timeout setting can not be obtained.

public static int getPassMinDuration()

Obtain the shortest detection time that can pass the liveness detection. Should be called after init to get the correct result. Otherwise, it will return -1.

public static int getPassMinFrames()

Obtain the minimum number of detection frames that can pass the liveness detection. Should be called after init to get the correct result. Otherwise, it will return -1.

public static float getFaceFarRate()

Obtain the farthest face distance threshold in the judgment condition. Should be called after init to get the correct result. Otherwise, it will return -1.

public static float getFaceCloseRate()

Obtain the closest face distance threshold in the judgment condition. Should be called after init to get the correct result. Otherwise, it will return -1.

public static String getSdkVersion()

Get the current SDK version number.

public static String getLibraryVersion()

Get the version number of the current internal library. After init succeeded, call this method to get the correct version number of the internal library.

Last updated