3.1 /liveness/silent_detection/stateless

Perform silent liveness detection on the server to decide whether the person in the uploaded video is a living human or not.

For video standards, refer to Chapter 3 Photo and Video Standards in the Operation Manual.

Request mode

POST

Request URL

http://ip:port/liveness/silent_detection/stateless

Request parameters

Name

Type

Required

Description

encrypted_video

string

Yes

Encrypted video Encryption method reference: [Photo and Video Encryption]

return_image

boolean

No

Whether to return the selected frame of face and timestamp of the selected frame of the photo. The default is false. image_timestamp and base64_image are returned only when this value is true and the live detection is passed.

return_face_image

boolean

No

Whether to return the face clipping of the selected frame of the photo. The default is false. base64_face_imageis returned only when this value is true and the live detection is passed.

return_status

boolean

No

Whether to return the error status description. The default is false. liveness_status is returned only when this value is true.

Normal response

Name

Type

Description

code

int

System response code: 1000

passed

boolean

Liveness detection passed or not

liveness_score

float

The score of silent liveness detection (for reference only, please refer to the passed field)

liveness_status

string

Description of the error status of silent liveness detection. This field is returned when return_status=true

image_timestamp

float

Timestamp of the selected frame of image in seconds. This field is returned only when passed=true and return_image=true

base64_image

string

The selected frame of the photo. This field is returned only when passed=true and return_image=true

base64_face_image

string

Face clipping of the selected frame of the photo. This field is returned only when passed=true and return_face_image=true

request_id

string

The ID of this request

The possible results ofliveness_statusare as follows:

Status

Description

ok

Silent liveness detection passed: the person in the video is real

hack

Silent liveness detection failed, reason: face spoofing (for example, photos taken by the mobile phone)

short_time

Silent liveness detection failed, reason: video time with the face is less than 2s

{
    "code": int,
    "passed": boolean,
    "liveness_score": float,
    "liveness_status": string,
    "image_timestamp": float,
    "base64_image": string,
    "base64_face_image": string,
    "request_id": string
}

Abnormal response

Name

Type

Instructions

code

int

System response code

message

string

Error Messages

request_id

string

The ID of this request

{
    "code": int,
    "message": string,
    "request_id": string
}

System response code

code

Field value

Description

1200

invalid argument

Invalid input parameter

2008

invalid video error

Invalid videos (video time is less than 2s)

4007

liveness silent check failed

Silent liveness detection failed

Possible HTTP status codes

status

Description

400

BAD_REQUEST

404

NOT_FOUND

411

LENGTH_REQUIRED

413

PAYLOAD_TOO_LARGE

500

INTERNAL_ERROR

Sample

curl -X POST "http://ip:port/liveness/silent_detection/stateless" \
  -d encrypted_video=xxx \
  -d return_status=true \
  -d return_image=true \
  -d return_face_image=true

Last updated