/detection/detect

Description

Return the face locations in the image and other face attributes.

  • Current attributes inlucde gender, age, race, smiling, glass and pose.
If no faceset/person contain the face_id, it will be deleted after 72 hours.

Parameter

 NameDescription
Required api_key Your registered API Key
  api_secret Your registered API Secret
  url or img[POST] url of the image to be detected, or the binary data of the image uploaded via POST.
Optional mode The detector mode, one of normal(default) or oneface. In oneface mode, only the largest face in the image would be found.
  attribute Can be none or a comma-separated list of desired attributes. Gender, age, race, smiling are default.  Currently supported attributes are: gender, age, race, smiling, glass and pose.
  tag A string to be associated with the faces, which could be later retrieved via /info/get_face. Should not exceed 255 characters.
  async If set to true, the API would be invoked asynchronously (i.e. a session id would be returned immediately, which could be later used to retrieve the result via /info/get_session). Defaults to false.

Return Values

FieldTypeDescription
session_id string Unique id of a session
url string Image url as specified in the request
img_id string Unique id of an image on Face++ platform
face_id string Unique id of a detected Face on Face++ platform
img_width integer Image width in pixels
img_height integer Image height in pixels
faces array A list of detected faces, each element is a description of Face
width float The width of detected face (as 0-100% of image width)
height float The height of detected face (as 0-100% of image width)
center object x & y coordinates of the center point of the detected face rectangle, as 0-100% of photo width and height
nose object x & y coordinates of nose, as 0-100% of photo width and height
eye_left object x & y coordinates of left eye, as 0-100% of photo width and height
eye_right object x & y coordinates of right eye, as 0-100% of photo width and height
mouth_left object x & y coordinates of left edge of mouth, as 0-100% of photo width and height
mouth_right object x & y coordinates of right edge of mouth, as 0-100% of photo width and height
attribute object List of detected facial attributes (currently gender and age)
gender object Male/Female value and confidence
age object Estimated age value and range
race object Asian/Black/White value and confidence
smiling object Estimated smiling degree
glass object None/Dark/Normal value and confidence
pose object Including pitch_angle, roll_angle, yaw_angle, in degree.

Parameter

https://apius.faceplusplus.com/v2/detection/detect?url=http%3A%2F%2Ffaceplusplus.com%2Fstatic%2Fimg%2Fdemo%2F1.jpg&api_secret=YOUR_API_SECRET&api_key=YOUR_API_KEY&attribute=glass,pose,gender,age,race,smiling

JSON Response


    "face": [
        {
            "attribute": {
                "age": {
                    "range": 5,
                    "value": 23
                },
                "gender": {
                    "confidence": 99.9999,
                    "value": "Female"
                },
                "glass": {
                    "confidence": 99.945,
                    "value": "None"
                },
                "pose": {
                    "pitch_angle": {
                        "value": 17
                    },
                    "roll_angle": {
                        "value": 0.735735
                    },
                    "yaw_angle": {
                        "value": -2
                    }
                },
                "race": {
                    "confidence": 99.6121,
                    "value": "Asian"
                },
                "smiling": {
                    "value": 4.86501
                }
            },
            "face_id": "17233b4b1b51ac91e391e5afe130eb78",
            "position": {
                "center": {
                    "x": 49.4,
                    "y": 37.6
                },
                "eye_left": {
                    "x": 43.3692,
                    "y": 30.8192
                },
                "eye_right": {
                    "x": 56.5606,
                    "y": 30.9886
                },
                "height": 26.8,
                "mouth_left": {
                    "x": 46.1326,
                    "y": 44.9468
                },
                "mouth_right": {
                    "x": 54.2592,
                    "y": 44.6282
                },
                "nose": {
                    "x": 49.9404,
                    "y": 38.8484
                },
                "width": 26.8
            },
            "tag": ""
        }
    ],
    "img_height": 500,
    "img_id": "22fd9efc64c87e00224c33dd8718eec7",
    "img_width": 500,
    "session_id": "38047ad0f0b34c7e8c6efb6ba39ed355",
    "url": "http://cn.faceplusplus.com/wp-content/themes/faceplusplus.zh/assets/img/demo/1.jpg?v=4"
}

Error Code List

Error CodeHTTP Status CodeError Message
1001 500 INTERNAL_ERROR
1003 403 AUTHORIZATION_ERROR
1003 403 INSUFFICIENT_PRIVILEGE_OR_QUOTA_LIMIT_EXCEEDED
1004 400 MISSING_ARGUMENTS
1005 400 INVALID_ARGUMENTS
1006 403 ILLEGAL_USE_OF_DEMO_KEY
1202 502 SERVER_TOO_BUSY
1301 431 IMAGE_ERROR_UNSUPPORTED_FORMAT
1302 432 IMAGE_ERROR_FAILED_TO_DOWNLOAD
1303 433 IMAGE_ERROR_FILE_TOO_LARGE
1304 434 IMAGE_ERROR
1502 452 BAD_TAG
Google+