---
title: "POST /detect"
method: POST
path: "/detect"
---

# POST /detect

`POST /detect`

Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes.<br />
* Optional parameters including faceId, landmarks, and attributes. Attributes include age, gender, headPose, smile, facialHair, glasses, emotion, hair, makeup, occlusion, accessories, blur, exposure and noise.
* The extracted face feature, instead of the actual image, will be stored on server. The faceId is an identifier of the face feature and will be used in [Face - Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239), [Face - Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a), and [Face - Find Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237). It will expire 24 hours after the detection call.
* Higher face image quality means better detection and recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
* JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB.
* Faces are detectable when its size is 36x36 to 4096x4096 pixels. If need to detect very small but clear faces, please try to enlarge the input image.
* Up to 64 faces can be returned for an image. Faces are ranked by face rectangle size from large to small.
* Face detector prefer frontal and near-frontal faces. There are cases that faces may not be detected, e.g. exceptionally large face angles (head-pose) or being occluded, or wrong image orientation.
* Attributes (age, gender, headPose, smile, facialHair, glasses, emotion, hair, makeup, occlusion, accessories, blur, exposure and noise) may not be perfectly accurate. HeadPose's pitch value is a reserved field and will always return 0.
* Different 'recognitionModel' values are provided. If follow-up operations like Verify, Identify, Find Similar are needed, please specify the recognition model with 'recognitionModel' parameter. The default value for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. More details, please refer to [How to specify a recognition model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model)

## Query parameters

- `returnFaceId` boolean
- `returnFaceLandmarks` boolean
- `returnFaceAttributes` string[]
- `recognitionModel` 'recognition_01' | 'recognition_02'
- `returnRecognitionModel` boolean

## Parameters

- `../../../Common/Parameters.json#/components/parameters/ImageUrl` — unresolved $ref

## Response `200`

A successful call returns an array of face entries ranked by face rectangle size in descending order. An empty response indicates no faces detected.

- DetectedFace[]
  - `faceId` string, uuid
  - `recognitionModel` 'recognition_01' | 'recognition_02' — Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition model name can be provided when performing Face - Detect or (Large)FaceList - Create or (Large)PersonGroup - Create. The default value is 'recognition_01', if latest model needed, please explicitly specify the model you need.
  - `faceRectangle` FaceRectangle, required — A rectangle within which a face can be found
    - `width` integer, required — The width of the rectangle, in pixels.
    - `height` integer, required — The height of the rectangle, in pixels.
    - `left` integer, required — The distance from the left edge if the image to the left edge of the rectangle, in pixels.
    - `top` integer, required — The distance from the top edge if the image to the top edge of the rectangle, in pixels.
  - `faceLandmarks` FaceLandmarks — A collection of 27-point face landmarks pointing to the important positions of face components.
    - `pupilLeft` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `pupilRight` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `noseTip` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `mouthLeft` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `mouthRight` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyebrowLeftOuter` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyebrowLeftInner` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyeLeftOuter` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyeLeftTop` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyeLeftBottom` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyeLeftInner` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyebrowRightInner` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyebrowRightOuter` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyeRightInner` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyeRightTop` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyeRightBottom` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `eyeRightOuter` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `noseRootLeft` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `noseRootRight` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `noseLeftAlarTop` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `noseRightAlarTop` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `noseLeftAlarOutTip` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `noseRightAlarOutTip` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `upperLipTop` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `upperLipBottom` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `underLipTop` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
    - `underLipBottom` Coordinate — Coordinates within an image
      - `x` number, required — The horizontal component, in pixels.
      - `y` number, required — The vertical component, in pixels.
  - `faceAttributes` FaceAttributes — Face Attributes
    - `age` number — Age in years
    - `gender` 'male' | 'female' — Possible gender of the face.
    - `smile` number — A number ranging from 0 to 1 indicating the intensity level associated with a property.
    - `facialHair` FacialHair — Properties describing facial hair attributes.
      - `moustache` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
      - `beard` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
      - `sideburns` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
    - `glasses` 'noGlasses' | 'readingGlasses' | 'sunglasses' | 'swimmingGoggles' — Glasses type if any of the face.
    - `headPose` HeadPose — Properties indicating head pose of the face.
      - `roll` number
      - `yaw` number
      - `pitch` number
    - `emotion` Emotion — Properties describing facial emotion in form of confidence ranging from 0 to 1.
      - `anger` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
      - `contempt` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
      - `disgust` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
      - `fear` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
      - `happiness` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
      - `neutral` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
      - `sadness` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
      - `surprise` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
    - `hair` Hair — Properties describing hair attributes.
      - `bald` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
      - `invisible` boolean — A boolean value describing whether the hair is visible in the image.
      - `hairColor` HairColor[]
        - `color` 'unknown' | 'white' | 'gray' | 'blond' | 'brown' | 'red' | 'black' | 'other' — Name of the hair color.
        - `confidence` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
    - `makeup` Makeup — Properties describing present makeups on a given face.
      - `eyeMakeup` boolean — A boolean value describing whether eye makeup is present on a face.
      - `lipMakeup` boolean — A boolean value describing whether lip makeup is present on a face.
    - `occlusion` Occlusion — Properties describing occlusions on a given face.
      - `foreheadOccluded` boolean — A boolean value indicating whether forehead is occluded.
      - `eyeOccluded` boolean — A boolean value indicating whether eyes are occluded.
      - `mouthOccluded` boolean — A boolean value indicating whether the mouth is occluded.
    - `accessories` Accessory[] — Properties describing any accessories on a given face.
      - `type` 'headWear' | 'glasses' | 'mask' — Type of an accessory
      - `confidence` number — A number ranging from 0 to 1 indicating a level of confidence associated with a property.
    - `blur` Blur — Properties describing any presence of blur within the image.
      - `blurLevel` 'Low' | 'Medium' | 'High' — An enum value indicating level of blurriness.
      - `value` number — A number ranging from 0 to 1 indicating the intensity level associated with a property.
    - `exposure` Exposure — Properties describing exposure level of the image.
      - `exposureLevel` 'UnderExposure' | 'GoodExposure' | 'OverExposure' — An enum value indicating level of exposure.
      - `value` number — A number ranging from 0 to 1 indicating the intensity level associated with a property.
    - `noise` Noise — Properties describing noise level of the image.
      - `noiseLevel` 'Low' | 'Medium' | 'High' — An enum value indicating level of noise.
      - `value` number — A number ranging from 0 to 1 indicating the intensity level associated with a property.

## Other responses

- `default` — Error response.

## Changes

- **2019-03-25** `37a7900a44ee` — 2 info
  - added the new optional `query` request parameter `recognitionModel`
  - added the new optional `query` request parameter `returnRecognitionModel`
- **2018-01-03** `d8fb8ca6c06c` — 1 info
  - api operation id `Face_Detect` removed and replaced with `Face_DetectWithUrl`
- **2017-12-28** `e67414f9aeba` — 4 warning, 1 info
  - deleted the `query` request parameter `detectionModel`
  - deleted the `query` request parameter `faceIdTimeToLive`
  - deleted the `query` request parameter `recognitionModel`
  - deleted the `query` request parameter `returnRecognitionModel`
  - …1 more

[Change history](https://skmtc.dev/azure/apis/cognitiveservices-face/changes/detect/post.md)

---

[API](https://skmtc.dev/azure/apis/cognitiveservices-face.md) · [All operations](https://skmtc.dev/azure/apis/cognitiveservices-face/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/cognitiveservices-face/revisions/37a7900a44ee/schema)
