SenseID Private Cloud
1.8.0, English, 1v1
1.8.0, English, 1v1
  • Introduction
  • Release Notes
  • Installation Manual
    • Revision History
    • 1 System Requirements
    • 2 UDID
    • 3 License Activation
    • 4 Service Deployment
    • 5 Deployment FAQ
  • Operation Manual
    • Revision History
    • 1 License Change and Renew
    • 2 Photo and Video Encryption
    • 3 Photo and Video Standards
    • 4 Update
    • 5 Error Codes
  • API Manual
    • Revision History
    • 1 Face Compare (Stateless)
      • 1.1 /identity/image_verification/stateless
      • 1.2 /identity/multiface_image_omni_verification/stateless
      • 1.3 /identity/liveness_image_verification/stateless
      • 1.4 /identity/silent_image_verification/stateless
    • 2 Quality Check
      • 2.1 /quality/face/stateless
    • 3 Liveness Detection
      • 3.1 /liveness/silent_detection/stateless
Powered by GitBook
On this page
  • Request mode
  • Request URL
  • Request parameters
  • Normal response
  • Abnormal response
  • System response code
  • Possible HTTP status codes
  • Sample

Was this helpful?

Export as PDF
  1. API Manual
  2. 2 Quality Check

2.1 /quality/face/stateless

Previous2 Quality CheckNext3 Liveness Detection

Last updated 3 years ago

Was this helpful?

Perform a quality check of the photo.

The photo file can contain multiple faces.

For photo standards, refer to in the .

Request mode

POST

Request URL

http://ip:port/quality/face/stateless

Request parameters

Name

Type

Required

Description

encrypted_image

string

Yes

Normal response

Name

Type

Description

code

int

System response code: 1000

faces

Array

Information about the quality of each face in the photo

request_id

string

The ID of this request

{
    "code": 1000,
    "faces": [
        {
            "rect": { # face frame position
                "left": integer, # The left border of the face frame is the X-coordinate, and the upper left corner of the image is the origin of coordinates
                "top": integer, # The top border of the face frame is the Y-coordinate, and the upper left corner of the image is the origin of coordinates
                "right": integer, # The right border of the face frame is the X-coordinate, and the upper left corner of the image is the origin of coordinates
                "bottom": integer # The bottom border of the face frame is the Y-coordinate, and the upper left corner of the image is the origin of coordinates
            },
            "pose": { # pose angle information
                "yaw": float, # rotation angle around the Y-axis
                "pitch": float, # rotation angle around the X-axis
                "roll": float # rotation angle around the Z-axis
            },
            "occlusion":{ # occlusion information
                "left_eye": float, # The proportion of left eye not occluded with value range between [0,1]. The larger the value, the less occlusion
                "right_eye": float, # The proportion of right eye not occluded with value range between [0,1]. The larger the value, the less occlusion
                "nose": float, # The proportion of nose not occluded with value range between [0,1]. The larger the value, the less occlusion
                "mouth": float, # The proportion of mouth not occluded with value range between [0,1]. The larger the value, the less occlusion
                "total": float # The proportion of five features not occluded with value range between [0,1]. The larger the value, the less occlusion
            },
            "distance2center": float, # The proportion of the distance of the face to the center of the image with value range between [0,1]. The higher the score, the closer the face to the center of the image. The calculation formula is as follows: max (1-distance from the center of five features to the center of the image/distance of the short side of the image, 0)
            "size": float, # The proportion of five features in the image with value range between [0,1]. The higher the score, the greater the proportion of five features: Area of the five features in the image/image area
            "brightness": float, # Face brightness score with value range between [-1,1]. The higher the score, the higher the brightness
            "sharpness": float, # Face sharpness score with value range between [0,1]. The higher the score, the higher the sharpness
            "mouth_open": float, # Degree of mouth opening with value range between [0,1]. The higher the score, the lower the degree of mouth opening
            "integrity": float # Integrity of the five features in the image, with value range between [0,1]. The higher the score, the more integral the face is in the image. The calculation formula is as follows: Area of the five features in the image/five features area
        }
    ],
    "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

2003

invalid image size

The image size (height and width in pixel) does not meet the requirements

2004

invalid content length

The image file size does not meet the requirements

2005

invalid image type or corrupted

The image type does not meet the requirements

4000

detection failed

Feature extraction failed, no face detected in the image

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/quality/face/stateless" \
  -d encrypted_image=xxx
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;

public class HttpClient {
    public static final String POST_URL = "http://127.0.0.1:3000/quality/face/stateless";
    private static AESCipher cipher = new AESCipher("dcbbad6765e14139a07d34b92292a672", "df25d188a061");

    public static void Post() throws Exception {
        CloseableHttpClient httpclient = HttpClients.createDefault();
        HttpPost post = new HttpPost(POST_URL);

        List<NameValuePair> params = new ArrayList<>();

        String encryptedImage = cipher.encrypt(
                Files.readAllBytes(Paths.get("src/main/resources/face_01.jpg")));

        params.add(new BasicNameValuePair("encrypted_image", encryptedImage));

        post.setEntity(new UrlEncodedFormEntity(params));
        HttpResponse response = httpclient.execute(post);

        if (response.getStatusLine().getStatusCode() == 200) {
            HttpEntity respEntity = response.getEntity();
            BufferedReader reader = new BufferedReader(new InputStreamReader(respEntity.getContent()));
            String line = reader.readLine();
            System.out.println(line);
        } else {
            HttpEntity respEntity = response.getEntity();
            String responseString = EntityUtils.toString(respEntity);
            System.out.println("error:" + response.getStatusLine().getStatusCode()
                    + "  " + response.getStatusLine().getReasonPhrase());
            System.out.println("cause of error:" +responseString);
        }
    }

    public static void main(String[] args) throws Exception {
        Post();
    }
}

Encrypted photo Encryption method reference:

Chapter 3 Photo and Video Standards
Operation Manual
[Photo and Video Encryption]