Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Vision
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Text recognition
    • Assessing image quality
    • Image moderation
    • Face detection
    • Base64 encoding
  • Concepts
    • Overview
    • Text recognition
      • Overview
      • Template recognition
      • Supported languages
      • Current version restrictions
    • Image classification
      • Overview
      • Supported models
    • Face detection
    • Quotas and limits
  • Access management
  • Pricing policy
  • API reference
    • Authentication in the API
    • gRPC
      • Обзор
      • VisionService
    • REST
      • Handling errors
      • Troubleshooting
      • Overview
      • Vision
        • Overview
        • batchAnalyze
  • Questions and answers
  1. Concepts
  2. Face detection

Face detection

  • Request format
  • Service response
  • Image requirements

Face detection is currently at the Preview stage.

This section describes how the face detection feature works in the service.

This feature lets you find human faces in an image. For example, you can use it to mark people in a photo or find all photos with portraits.

Note

This feature doesn't recognize faces. You will not be able to use it to find similar faces or identify a person.

Request format

In the feature type, specify FACE_DETECTION:

{
    "folderId": "b1gvmob95yysaplct532",
    "analyze_specs": [{
        "content": "iVBORw0KGgo...",
        "features": [{
            "type": "FACE_DETECTION"
        }]
    }]
}

Service response

The service searches for human faces in the image and marks them with rectangles. In the response, the service returns the coordinates of the rectangles for all detected faces:

image

If two faces are adjacent, the rectangles may intersect.

The coordinates of a rectangle are calculated from the upper-left corner and specified counterclockwise:

1←4
↓ ↑
2→3

Sample response with the coordinates of the detected face:

{
  "results": [{
    "results": [{
      "faceDetection": {
        "faces": [{
          "boundingBox": {
            "vertices": [{
                "x": "410",
                "y": "404"
              },
              {
                "x": "410",
                "y": "467"
              },
              {
                "x": "559",
                "y": "467"
              },
              {
                "x": "559",
                "y": "404"
              }
            ]
          }
        }]
      }
    }]
  }]
}

Image requirements

An image in a request must meet the following requirements:

  • Supported file formats: JPEG, PNG, PDF.

    You specify the MIME type of the file in the mime_type property. The default is image.

  • Maximum file size: 1 MB.

  • Image size should not exceed 20 MP (length x width).

What's next

  • Try detecting faces in an image
  • See how to handle errors
In this article:
  • Request format
  • Service response
  • Image requirements
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC