Face Analysis API

Check an ID-photo portrait for pose, expression, glasses, lighting, and sharpness. Emotion, age, and gender scores are not in the API reference.

Developers searching for face analysis often want emotion, age, or gender. Those scores are not in this API. What the Passport Photo API does return, on a successful POST /v2/makeIdPhoto, is an issues array: pose, expression, glasses, light, sharpness, and framing. That is the analysis. The catalog is photo issue codes. Comparing two people is the Face Match API, not an attribute guess.

Issue codes are the face analysis

An issue code is not an HTTP error. The request can succeed and still list problems. An empty issues array means none of the checks that ran reported a problem. It does not mean a government office has accepted the photo. Map codes to short instructions. Do not show raw codes to the person holding the phone.

Sample portrait used for ID photo pose, light, and expression checks
The checks look at whether the portrait is usable for an ID photo. They do not label emotion, age, or gender.

Checks the response can include

CodeMeaningWhat to ask for
ISSUE_FACE_NOT_FOUNDNo usable face.One person, full face visible.
ISSUE_HEAD_YAW_OVER_THRESHOLDHead turned too far.Face the camera.
ISSUE_HEAD_PITCH_OVER_THRESHOLDHead tilted up or down.Hold the head upright.
ISSUE_EXPRESSION_NOT_NEUTRALExpression is not neutral.Closed mouth, relaxed face. This is not an emotion score.
ISSUE_EYEGLASSES_NOT_ALLOWEDGlasses where the spec disallows them.Remove glasses and retake.
ISSUE_EYEGLASSES_REFLECTIONGlare on the lenses.Change angle or remove glasses.
ISSUE_FACE_LIGHT_NOT_BALANCEUneven light across the face.Softer, more even light.
ISSUE_FACE_BRIGHTNESS_BADToo dark or too bright.Avoid backlight and direct flash.
ISSUE_PHOTO_SHARPNESS_BADBlur or not enough detail.Hold still and refocus. Ask for this before smaller framing nits.
ISSUE_BOTTOM_NOT_FULL, ISSUE_LEFT_NOT_FULL, ISSUE_RIGHT_NOT_FULLNot enough shoulder or torso in the source.Step back and include both shoulders.

ISSUE_SUNGLASSES_NOT_ALLOWED, ISSUE_HAT_NOT_ALLOWED, and ISSUE_NOT_IN_COLOR are in the same list. ISSUE_MASK_NOT_ALLOWED and ISSUE_RELIGION_MASK_FOUND are marked coming soon in the docs. ISSUE_PHOTO_SPEC_NOT_EXIST means the specCode was unknown. The user-facing version of the same problems is common passport photo mistakes.

A response that found problems

Direct mode returns the sized file and the issues together. This sample uses the UK passport spec from the API reference. Dimensions in the docs for that example are 413 × 531 pixels at 300 DPI.

{
  "photoUuid": "example-photo-uuid",
  "waterMark": false,
  "specCode": "uk-passport",
  "widthPx": 413,
  "heightPx": 531,
  "photoDpi": 300,
  "issues": [
    "ISSUE_EXPRESSION_NOT_NEUTRAL",
    "ISSUE_FACE_LIGHT_NOT_BALANCE"
  ]
}

When several codes come back, lead with the one that forces a retake. The docs’ example is blur before a small positioning issue. For a UK passport photo code, do not edit the face to clear the list. Ask for another photo.

Sensitivity overrides

Selected checks accept issueSensitivityOverride on the Passport Photo API: VERY_LOW, LOW, MEDIUM, HIGH, or VERY_HIGH. Higher is stricter. The default in the photo-code reference is MEDIUM. Overrides change detection. They do not change the document specification. Do not drop sensitivity to hide a real problem on a government photo.

"issueSensitivityOverride": {
  "ISSUE_FACE_LIGHT_NOT_BALANCE": "MEDIUM",
  "ISSUE_HEAD_YAW_OVER_THRESHOLD": "MEDIUM",
  "ISSUE_PHOTO_SHARPNESS_BAD": "HIGH"
}

The override keys in the Passport Photo API request example are lighting, brightness, sharpness, yaw, pitch, glasses, sunglasses, hats, and incomplete edges. ISSUE_EXPRESSION_NOT_NEUTRAL is returned as an issue. It is not in that override example, so do not invent a sensitivity key for it.

Apps, booths, studios, and HR

How to read issue codes in your app

  1. Call POST /v2/makeIdPhoto with the specCode you will actually deliver. Analysis without the target spec misses rules that depend on the document, such as glasses.
  2. If issues is empty, continue.
  3. If it is not, map each code to a localized sentence and choose warn, review, or retake.
  4. Put the most blocking instruction first when there are several.
  5. Keep images and secrets on the server. URL output uses temporary storage. Base64 output can avoid storing the image on our service. Details are in the data privacy policy.

Why issue codes instead of an attribute model

Emotion recognition in workplaces and schools is restricted in some jurisdictions, and this reference does not offer it. Age and gender are not returned either. Issue codes are tied to the photo you are about to submit: a head turned too far, a smile, glare on glasses, a dark face. That is the analysis an ID-photo product can act on without inventing a sensitive classifier.

FAQ

Does the Face Analysis API return emotion, age, or gender?

No. Those scores are not in the API reference. The documented analysis is the issues array from the Passport Photo API: face detection, pose, expression, glasses, lighting, sharpness, and framing.

Is a non-neutral expression an emotion score?

No. ISSUE_EXPRESSION_NOT_NEUTRAL means the expression is not neutral enough for the photo check. The suggested action in the docs is a closed mouth and a relaxed face. It is not a happiness or anger label.

Does an empty issues array mean the passport will be accepted?

No. It means the checks that ran did not report a listed problem. The issuing authority still reviews the photo. For UK passports, HM Passport Office checks every photo submitted with a photo code.

Can I make the checks stricter?

Yes for the checks that support issueSensitivityOverride. Values run from VERY_LOW to VERY_HIGH. Higher is stricter. Overrides do not change the selected document specification.

Should I analyze the photo with a separate endpoint?

No separate analysis endpoint is documented. Call POST /v2/makeIdPhoto with the destination spec code and read issues on that response.

Ready to Integrate Face Analysis?

Contact us to discuss your specific use case and discover how Face Analysis API can enhance your application.