Detect Faces on Images

Drop an image below and to find faces on it.
It will return the location of each one found.


Simplify Face Detection with TuttoApi

Are you building applications that require accurate face detection? TuttoApi offers a streamlined solution that allows you to quickly and easily identify faces within images with minimal effort.

What Can Face Detection Do?

  • Fast, Precise Face Detection: Our tool delivers accurate face detection results in milliseconds.
  • Automated Analysis: Eliminate manual inspection and reduce the risk of errors.
  • Rapid Integration: Easily integrate face detection into your existing workflows using our API - quickly build applications.
  • Simple Upload: Upload images with a few clicks.

Try it!

Upload an image on the form above to test it.

Here is how to detect faces on images progamatically

Python

            
import requests
url = "https://tuttoapi.com/api/face-detector/",
files = {"file": open('/path/to/image.jpeg', 'rb')},
headers = {"AUTHORIZATION": "Token YOUR_TOKEN"}

response = requests.post(url, files=files, headers=headers)
print(response.json())
            
        

Curl / Bash

            
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Token YOUR_TOKEN" \
  -d '{"file": "path/to/image.jpg"}' \
  https://tuttoapi.com/api/face-detector/
            
        

Javascript

            
var input = document.querySelector('input[type="file"]')

var data = new FormData()
data.append('file', input.files[0])

fetch("http://tuttoapi.com/api/face-detector/", {
    method: 'POST',
    body: data,
    headers: { 'AUTHORIZATION': 'Token YOUR_TOKEN' }
})
.then(response => {
    response.json().then(result => {
        console.log(result)
    })
});
            
        

Ready to Get Started?

  1. Create an account
  2. Get your API key
  3. Call the api, Upload the image you want to analyze.
  4. Get results: See the bounding box coordinates for each detected face.
  5. Explore the Documentation: Learn more about best practices for face detection.

Calling the api to detect faces on images

Here is an outline of the process of utilizing the API for face detection. This API allows you to quickly and reliably detect faces in images, integrating seamlessly into your software projects.

Account Creation & Token Validation

You’ll need to create an account to obtain a unique API Token.

Upon successful account creation, you will receive a Token, this is crucial for authenticating your API requests. Never hardcode your Token directly into your code. Store it securely.

API Call Procedure

You can call the API using a RESTful HTTP request. Here’s a breakdown of the process:

API Endpoint:

The primary endpoint for face detection is: https://tuttoapi.com/api/face-detector/

Request Parameters:

The following parameters are required for each API call:
  • file (Required): The path to the image file you wish to analyze.
  • algorithm (Optional): Specifies the face detection algorithm to use.
  • scale_factor (Optional): how much the image size is reduced at each image scale.
  • min_neighbors (Optional): how many neighbors each candidate rectangle should have to retain it.

API Call Example (using `curl` - see example below):

```bash
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Token YOUR_TOKEN" \
  -d '{
    "file": "path/to/your/image.jpg",
    "algorithm": "frontalface_default",
    "scale_factor": 1.1,
    "min_neighbors": 4
  }' \
  https://tuttoapi.com/api/face-detector/
```

Response:

The API returns a JSON response containing:
  • status: 200 OK or 400 Bad Request (for invalid parameters)
  • data: A JSON object containing the detected faces.

Format

The data will return a list of the bounding boxes coordinates for each detected face within the image.
{
    "landmarks": [
        {
            "x": 103,
            "y": 126,
            "width": 309,
            "height": 309
        }
    ]
}

Error Handling

  • 400 Bad Request: Returned if the request is malformed (e.g., missing required parameters, invalid data types).
  • 401 Unauthorized: Returned if the token is invalid.
  • 429 Too Many Requests: Returned if you exceed the rate limit.