API reference

Detect faces

Find every face in an image and get boxes plus aligned crops.

POST /v1/face-recognition/detect1 operation per image, however many faces it finds

The programmatic form of Detect faces in the dashboard — same models, same allowance.

Request

multipart/form-data, with your key as a bearer token.

FieldTypeDefaultDescription
imagerequiredfileJPEG, PNG or WebP.
modelstringscrfdDetection model variant.

Example

curl -X POST https://api.quantilence.com/v1/face-recognition/detect \
  -H "Authorization: Bearer $QUANTILENCE_API_KEY" \
  -F "image=@photo.jpg" \
  -F "model=scrfd"

Response

200 OK with this shape. Values below are illustrative; the keys and types are not.

{
  "success": true,
  "faces_detected": 2,
  "faces": [
    {
      "face_index": 0,
      "bbox_px": [
        412,
        188,
        523,
        361
      ],
      "bbox_norm": [
        0.402,
        0.245,
        0.511,
        0.47
      ],
      "det_score": 0.914,
      "crop_b64": "/9j/4AAQSkZJRg…"
    }
  ],
  "image_width": 1024,
  "image_height": 768,
  "model": "scrfd",
  "processing_time_ms": 143.8
}
FieldTypeDescription
successbooleanAlways true on a 200.
faces_detectedintegerHow many were found.
facesFace[]One entry per detected face.
faces[].face_indexintegerPosition in this response.
faces[].bbox_pxint[4][x1, y1, x2, y2] in image pixels.
faces[].bbox_normfloat[4]The same box, normalised 0–1.
faces[].det_scorefloatDetector confidence, 0–1.
faces[].crop_b64stringAligned face crop, base64 JPEG.
image_widthintegerDecoded width in pixels.
image_heightintegerDecoded height in pixels.
modelstringModel used.
processing_time_msfloatModel time.

Worth knowing

  • One operation regardless of how many faces come back.
  • Both box forms are returned so you never have to multiply by the frame yourself.