Face

Compare Face

This method helps you to compare face between 2 images <br> You will receive a response consists of message and an error code if the request fails to process. The following is a list of error codes. <br>

Error statusError codeDescription
200FAIL_ON_1fail on liveness
200FAIL_ON_2fail on attribute
200FAIL_ON_3fail on liveness and attribute
200FAIL_ON_4fail on quality
200FAIL_ON_5fail on liveness and quality
200FAIL_ON_6fail on attribute and quality
200FAIL_ON_7fail on liveness, attribute, and quality
200FAIL_ON_8fail on number of face (nface)
200FAIL_ON_9fail on number of face (nface) and liveness
200FAIL_ON_10fail on number of face (nface) and attribute
200FAIL_ON_11fail on number of face (nface), attribute, and liveness
200FAIL_ON_12fail on number of face (nface) and quality
200FAIL_ON_13fail on number of face (nface), quality, and liveness
200FAIL_ON_14fail on number of face (nface), quality, and attribute
200FAIL_ON_15fail on number of face (nface), quality, attribute, and liveness
200FAIL_ON_16fail on similarity status
400INVALID_PAYLOADno value in payload or empty string more than 1
400INVALID_PAYLOAD_IMAGE_1_MISSINGinvalid payload image 1 not a standard b64/url or image empty string
400INVALID_PAYLOAD_IMAGE_2_MISSINGinvalid payload image 2 not a standard b64/url or image empty string
400INVALID_PAYLOAD_IMAGE_1_SIZEinvalid payload image 1 size too large
400INVALID_PAYLOAD_IMAGE_2_SIZEinvalid payload image 2 size too large
400MISSING_PAYLOAD_IMAGE_1missing payload image 1
400MISSING_PAYLOAD_IMAGE_2missing payload image 2
400INVALID_PAYLOAD_IMAGE_1_TIMEOUTtimeout getting image 1 from url in 15 seconds
400INVALID_PAYLOAD_IMAGE_2_TIMEOUTtimeout getting image 2 from url in 15 seconds
400INVALID_PAYLOAD_IMAGE_1_FORMATimage unable to be decoded/got from url OR invalid image 1 extension
400INVALID_PAYLOAD_IMAGE_2_FORMATimage unable to be decoded/got from url OR invalid image 2 extension
400FACE_NOT_DETECTEDface not detected from image
400INVALID_PAYLOAD_QUALITY_VALIDATION_DEPENDENCYis_quality must be true if validate_quality true
400INVALID_PAYLOAD_ATTRIBUTE_VALIDATION_DEPENDENCYis_attribute must be true if validate_attribute true
400INVALID_PAYLOAD_LIVENESS_VALIDATION_DEPENDENCYis_liveness must be true if validate_liveness true
400INVALID_PAYLOAD_THRESHOLD_MISSINGthreshold must be basic/moderate/high
403INSUFFICIENT_QUOTA_COMPAREusage reach it quota limit for compare (only appears on testing mode)
403INSUFFICIENT_QUOTA_LIVENESSusage reach it quota limit for liveness (only appears on testing mode)
500INTERNAL_SERVER_ERRORinternal server error
post/v1/face/compare

Request

  • Base URL
    https://api.verihubs.com
  • URL
    https://api.verihubs.com/v1/face/compare
  • Auth
    none declared. Required headers: App-ID, API-Key

Headers

App-IDstring required
API-Keystring required

Request body

image_1string required

An image file, base64 or URL of the first person.

image_2string required

An image file, base64 or URL of the second person.

is_qualityboolean

A flag to determine whether Image Quality (blur, dark, grayscale) will be computed and return as result. Quality will be computed for both image_1 and image_2 when set as true

is_attributeboolean

A flag to determine whether Image Attribute (sunglasses, mask, veil, hat) will be detected and return as result. Attribute will be computed for both image_1 and image_2 when set as true

is_livenessboolean

A flag to determine whether Passive Liveness will be computed and return as result. Liveness will be computed for both image_1 and image_2 when set as true. When is_liveness is set to true, it is best that validate_quality is set to true, as liveness is influenced by Quality.

validate_qualityboolean

Determines whether Quality validation will be executed. The validation consists of checking blur and dark with threshold, and also checking whether the image is a black & white image (grayscale is true).

validate_attributeboolean

Determines whether attribute validation will be executed. The validation consists of checking whether sunglasses or mask is detected in the input image.

validate_livenessboolean

Determines whether Liveness validation will be executed. The validation checks whether input image is live / spoof.

thresholdstring

Determines which threshold level will be used. The threshold either basic/moderate/high

validate_nfaceboolean

Determines whether the number of faces validation will be executed. The validation checks whether the input image consists of more than one face.

Response

Successful Response

status_codestring

Status Code

messagestring required

Message

session_idstring

unique id to represent transaction record

similarity_statusboolean

Shows similarity result

timestampnumber

Shows time which face compared successfully

Example response

{
  "status_code": "FACE-1",
  "message": "Face compared successfully",
  "image_1": {
    "liveness": {
      "probability": "100"
    },
    "nface": 1,
    "bounding_box": {
      "TopLeftX": "0.9",
      "TopLeftY": "0.9",
      "BottomRightX": "0.9",
      "BottomRightY": "0.9",
      "Width": "0.9",
      "Height": "0.9"
    },
    "face_landmark": {
      "LeftEyeX": "0.9",
      "LeftEyeY": "0.9",
      "RightEyeX": "0.9",
      "RightEyeY": "0.9",
      "NoseX": "0.9",
      "NoseY": "0.9",
      "MouthLeftX": "0.9",
      "MouthLeftY": "0.9",
      "MouthRightX": "0.9",
      "MouthRightY": "0.9"
    }
  },
  "image_2": {
    "liveness": {
      "probability": "100"
    },
    "nface": 1,
    "bounding_box": {
      "TopLeftX": "0.9",
      "TopLeftY": "0.9",
      "BottomRightX": "0.9",
      "BottomRightY": "0.9",
      "Width": "0.9",
      "Height": "0.9"
    },
    "face_landmark": {
      "LeftEyeX": "0.9",
      "LeftEyeY": "0.9",
      "RightEyeX": "0.9",
      "RightEyeY": "0.9",
      "NoseX": "0.9",
      "NoseY": "0.9",
      "MouthLeftX": "0.9",
      "MouthLeftY": "0.9",
      "MouthRightX": "0.9",
      "MouthRightY": "0.9"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.