analysis_faces (self, **kwargs) method

  • invoke the face detection interface to return the results
    * Request Syntax

    image = Image(uri="fds://cnbj2.fds.api.xiaomi.com/vision-test/test_img.jpg") detect_faces_request = DetectFacesRequest(image) faces_list = vision_client.analysis_faces(detect_faces_request)

Parameters

detect_faces_request : Detectfacesrequest object, you must

Users must provide the necessary information and data when invoking the face detection interface. See DetectFacesRequest

Response syntax

    {"faceInfo": [{
                        "facePos": {
                            "faceX": 58,
                            "faceY": 89,
                            "faceH": 92,
                            "faceW": 11,
                            "eyeLeftX": 54,
                            "eyeLeftY": 33,
                            "eyeRightX": 52,
                            "eyeRightY": 56,
                            "noseX": 29,
                            "noseY": 37,
                            "mouthLeftX": 65,
                            "mouthLeftY": 78,
                            "mouthRightX": 23,
                            "mouthRightY": 77
                        },
                        "ageInfo": {
                            "age": 18,
                            "confidence": 0.2956333
                        },
                        "genderInfo": {
                            "gender": "Male",
                            "confidence": "0.8856695"
                        }
                  }]
    }

facePos

faceX,faceY,faceH,faceW,eyeLeftX,eyeLeftY,eyeRightX,eyeRightY,noseX,noseY,mouthLeftX,mouthLeftY,mouthRightX,mouthRightY are all int;
faceX,Y,H,W represents the detected rectangular area of the face; eyeLeftX,eyeLeftY,eyeRightX,eyeRightY represent the coordinate information of the two eyes detected; noseX,noseY represents the coordinate information of the detected nose; mouthLeftX,mouthLeftY,mouthRightX, mouthRightY indicates the detected mouth coordinate information

ageInfo

Age int
Age recognition of a face. Confidence int
Corresponding to the confidence degree for the detected age

genderInfo

Gender string
Gender recognition of a face Confidence int
Corresponding to the confidence degree for the gender detected