Facial Recognition API

215

This face detection API detects and recognizes faces in any image or video frame. By leveraging a deep neural network trained on small, blurry, and shadowy faces of all ages, this service is able to automatically detect faces with a high level of accuracy.

url upload file upload


API Docs
QUICK START API REQUEST
curl \
    -F 'image=YOUR_IMAGE_URL' \
    -H 'api-key:YOUR_API_KEY' \
    https://api.deepai.org/api/facial-recognition 

Detect Faces

in images and video fames

Not only can you detect and outline the faces in an image, you can also detect faces in a video -- meaning you can scan security feeds and group photos with ease.

Robust

to scale, age, and quality

This face detection API is able to recognize faces partially covered in shadowy or low-quality images

Label Faces

for media tagging

Categorize your media library based on the presence of faces or label all of the faces within an image for further analysis.

Detect Blurry Faces

Analyzing clear, sharp images is easy. Blurry images are harder. Our API can process blurry images and still detect faces, so even if that image you took without looking is too blurry, it still works with the neural model.


Detect Multiple Faces

Even small faces in the background of an image will get picked up by this face detection API. Wether they are babies, children, adults, or elderly, our model will detect and label them automatically.


Detect Shadowy faces

Trained on partial faces, profiles, and faces with shadows cast over them - our face detection API will detect and recognize every face in an image or video frame.


Facial Recognition API Documentation

Facial Recognition cURL Examples

# Example posting a image URL:

curl \
    -F 'image=YOUR_IMAGE_URL' \
    -H 'api-key:YOUR_API_KEY' \
    https://api.deepai.org/api/facial-recognition 


# Example posting a local image file:

curl \
    -F 'image=@/path/to/your/file.jpg' \
    -H 'api-key:YOUR_API_KEY' \
    https://api.deepai.org/api/facial-recognition 



# Video Mode: Supports files, URLs, and YouTube URLs. See full details and other options at https://deepai.org/api-docs/#video-recognition-api

# Example posting a video URL:

curl \
    -F 'video=YOUR_VIDEO_URL' \
    -H 'api-key:YOUR_API_KEY' \
    https://api.deepai.org/api/facial-recognition 


# Example posting a local video file:

curl \
    -F 'video=@/path/to/your/file.mp4' \
    -H 'api-key:YOUR_API_KEY' \
    https://api.deepai.org/api/facial-recognition 

Facial Recognition Javascript Examples

// Get the 'deepai' package here (Compatible with browser & nodejs):
//     https://www.npmjs.com/package/deepai
// All examples use JS async-await syntax, be sure to call the API inside an async function.
//     Learn more about async-await here: https://javascript.info/async-await

// Example posting a image URL:

const deepai = require('deepai'); // OR include deepai.min.js as a script tag in your HTML

deepai.setApiKey('YOUR_API_KEY');

(async function() {
    var resp = await deepai.callStandardApi("facial-recognition", {
            image: "YOUR_IMAGE_URL",
    });
    console.log(resp);
})()


// Example posting file picker input image (Browser only):

const deepai = require('deepai'); // OR include deepai.min.js as a script tag in your HTML

deepai.setApiKey('YOUR_API_KEY');

(async function() {
    var resp = await deepai.callStandardApi("facial-recognition", {
            image: document.getElementById('yourFileInputId'),
    });
    console.log(resp);
})()


// Example posting a local image file (Node.js only):
const fs = require('fs');

const deepai = require('deepai'); // OR include deepai.min.js as a script tag in your HTML

deepai.setApiKey('YOUR_API_KEY');

(async function() {
    var resp = await deepai.callStandardApi("facial-recognition", {
            image: fs.createReadStream("/path/to/your/file.jpg"),
    });
    console.log(resp);
})()



// Video Mode: Supports files, URLs, and YouTube URLs. See full details and other options at https://deepai.org/api-docs/#video-recognition-api


// Get the 'deepai' package here (Compatible with browser & nodejs):
//     https://www.npmjs.com/package/deepai
// All examples use JS async-await syntax, be sure to call the API inside an async function.
//     Learn more about async-await here: https://javascript.info/async-await

// Example posting a video URL:

const deepai = require('deepai'); // OR include deepai.min.js as a script tag in your HTML

deepai.setApiKey('YOUR_API_KEY');

(async function() {
    var resp = await deepai.callStandardApi("facial-recognition", {
            video: "YOUR_VIDEO_URL",
    });
    console.log(resp);
})()


// Example posting file picker input video (Browser only):

const deepai = require('deepai'); // OR include deepai.min.js as a script tag in your HTML

deepai.setApiKey('YOUR_API_KEY');

(async function() {
    var resp = await deepai.callStandardApi("facial-recognition", {
            video: document.getElementById('yourFileInputId'),
    });
    console.log(resp);
})()


// Example posting a local video file (Node.js only):
const fs = require('fs');

const deepai = require('deepai'); // OR include deepai.min.js as a script tag in your HTML

deepai.setApiKey('YOUR_API_KEY');

(async function() {
    var resp = await deepai.callStandardApi("facial-recognition", {
            video: fs.createReadStream("/path/to/your/file.mp4"),
    });
    console.log(resp);
})()

Facial Recognition Python Examples

# Ensure your pyOpenSSL pip package is up to date
# Example posting a image URL:

import requests
r = requests.post(
    "https://api.deepai.org/api/facial-recognition",
    data={
        'image': 'YOUR_IMAGE_URL',
    },
    headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())


# Example posting a local image file:

import requests
r = requests.post(
    "https://api.deepai.org/api/facial-recognition",
    files={
        'image': open('/path/to/your/file.jpg', 'rb'),
    },
    headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())



# Video Mode: Supports files, URLs, and YouTube URLs. See full details and other options at https://deepai.org/api-docs/#video-recognition-api


# Ensure your pyOpenSSL pip package is up to date
# Example posting a video URL:

import requests
r = requests.post(
    "https://api.deepai.org/api/facial-recognition",
    data={
        'video': 'YOUR_VIDEO_URL',
    },
    headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())


# Example posting a local video file:

import requests
r = requests.post(
    "https://api.deepai.org/api/facial-recognition",
    files={
        'video': open('/path/to/your/file.mp4', 'rb'),
    },
    headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())

Facial Recognition Ruby Examples

# Example posting a image URL:

require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/facial-recognition', timeout: 600,
    headers: {'api-key' => 'YOUR_API_KEY'},
    payload: {
        'image' => 'YOUR_IMAGE_URL',
    }
)
puts r


# Example posting a local image file:

require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/facial-recognition', timeout: 600,
    headers: {'api-key' => 'YOUR_API_KEY'},
    payload: {
        'image' => File.new('/path/to/your/file.jpg'),
    }
)
puts r



# Video Mode: Supports files, URLs, and YouTube URLs. See full details and other options at https://deepai.org/api-docs/#video-recognition-api

# Example posting a video URL:

require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/facial-recognition', timeout: 600,
    headers: {'api-key' => 'YOUR_API_KEY'},
    payload: {
        'video' => 'YOUR_VIDEO_URL',
    }
)
puts r


# Example posting a local video file:

require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/facial-recognition', timeout: 600,
    headers: {'api-key' => 'YOUR_API_KEY'},
    payload: {
        'video' => File.new('/path/to/your/file.mp4'),
    }
)
puts r

Facial Recognition Csharp Examples

// Ensure your DeepAI.Client NuGet package is up to date: https://www.nuget.org/packages/DeepAI.Client
// Example posting a image URL:

using DeepAI; // Add this line to the top of your file

DeepAI_API api = new DeepAI_API(apiKey: "YOUR_API_KEY");

StandardApiResponse resp = api.callStandardApi("facial-recognition", new {
        image = "YOUR_IMAGE_URL",
});
Console.Write(api.objectAsJsonString(resp));


// Example posting a local image file:

using DeepAI; // Add this line to the top of your file

DeepAI_API api = new DeepAI_API(apiKey: "YOUR_API_KEY");

StandardApiResponse resp = api.callStandardApi("facial-recognition", new {
        image = File.OpenRead("C:\\path\\to\\your\\file.jpg"),
});
Console.Write(api.objectAsJsonString(resp));



// Video Mode: Supports files, URLs, and YouTube URLs. See full details and other options at https://deepai.org/api-docs/#video-recognition-api


// Ensure your DeepAI.Client NuGet package is up to date: https://www.nuget.org/packages/DeepAI.Client
// Example posting a video URL:

using DeepAI; // Add this line to the top of your file

DeepAI_API api = new DeepAI_API(apiKey: "YOUR_API_KEY");

StandardApiResponse resp = api.callStandardApi("facial-recognition", new {
        video = "YOUR_VIDEO_URL",
});
Console.Write(api.objectAsJsonString(resp));


// Example posting a local video file:

using DeepAI; // Add this line to the top of your file

DeepAI_API api = new DeepAI_API(apiKey: "YOUR_API_KEY");

StandardApiResponse resp = api.callStandardApi("facial-recognition", new {
        video = File.OpenRead("C:\\path\\to\\your\\file.mp4"),
});
Console.Write(api.objectAsJsonString(resp));