Face Detection API: How To Use the API | RapidAPI

Face Detection

FREEMIUM
By inferdo
Updated 24 days ago
Visual Recognition
9.2/10
Popularity Score
907ms
Latency
100%
Success Rate

Face Detection API Overview

Use our Face Detection API to detect the location of human faces in your images.

Need more information? Then use our Face Age and Gender API to detect the location of faces with each of their predicted gender and age.

Contact API Provider
star-blueRate

Affordable Computer Vision

Easily integrate our Computer Vision API to add some Machine Learning magic✨ to your app. At inferdo, we pride ourselves in our ability to offer state-of-the-art, pre-trained deep learning models, but also our ability to efficiently serve them at scale. That means we can pass the savings on to you! Simply provide an image URL to our API and we'll handle the rest.

The returned object includes the locations of the detected faces encoded in the form of the top-left and bottom-right pixel coordinates of the face's bounding box, and the probability of the detected bounding box region being a face.

To increase the accuracy of your request, in a trade-off of API response time, use the optional "accuracy_boost" param to boost model accuracy. Valid arguments are values in the range 1 to 4, with 1 being the fastest and least accurate model and 4 being the most accurate and slowest model. We recommend 2 for most use cases.

example request:

{
    "url": "https://www.inferdo.com/img/face-2.jpg", 
    "accuracy_boost": 2
}

example response:

{
    "Detected_faces": [
        {
            "BoundingBox": {
                "startX": 264,
                "startY": 196,
                "endX": 302,
                "endY": 237
            },
            "Probability": 99.97026324272156
        },
        {
            "BoundingBox": {
                "startX": 353,
                "startY": 189,
                "endX": 383,
                "endY": 235
            },
            "Probability": 99.37525391578674
        },
        {
            "BoundingBox": {
                "startX": 420,
                "startY": 179,
                "endX": 444,
                "endY": 221
            },
            "Probability": 84.73355770111084
        },
        {
            "BoundingBox": {
                "startX": 214,
                "startY": 145,
                "endX": 246,
                "endY": 213
            },
            "Probability": 59.6186101436615
        }
    ]
}

Age and Gender

Need more information about the detected faces? Try our Age and Gender endpoint! On top of detecting the location of faces in a similar manner as above, we will also return the predicted binary genders for each face and an age range of possible ages for the face.

example request:

{
    "url": "https://www.inferdo.com/img/face-3.jpg", 
    "accuracy_boost": 3
}

example response:

{
    "detected_faces": [
        {
            "BoundingBox": {
                "startX": 291,
                "startY": 118,
                "endX": 353,
                "endY": 201,
                "Probability": 75.1505434513092
            },
            "Gender": {
                "Gender": "male",
                "Probability": 60.79372763633728
            },
            "Age": {
                "Age-Range": {
                    "Low": 23,
                    "High": 30
                }
            }
        },
        {
            "BoundingBox": {
                "startX": 457,
                "startY": 168,
                "endX": 520,
                "endY": 250,
                "Probability": 47.04744219779968
            },
            "Gender": {
                "Gender": "female",
                "Probability": 74.23571944236755
            },
            "Age": {
                "Age-Range": {
                    "Low": 19,
                    "High": 21
                }
            }
        }
    ]
}

Install SDK for (Node.js)Unirest

OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication