Superface

Face Detection

computer-vision/face-detection@1.0.2
1 provider

Face Detection

Detects faces on publicly-accessible image URL

Input
Image URL
Result
faces

1.Choose a provider

2.Use FaceDetection with mock in your code

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('computer-vision/face-detection@1.0.2');

  // Use the profile
  const result = await profile
    .getUseCase('FaceDetection')
    .perform({
      imageUrl: 'https://upload.wikimedia.org/wikipedia/commons/c/c3/RH_Louise_Lillian_Gish.jpg'
    }, {
      provider: 'mock'
    });

  // Handle the result
  try {
    const data = result.unwrap();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

run();

Structure details

Input (object)

imageUrl
Publicly-accessible image URL

Example

{
  "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/c/c3/RH_Louise_Lillian_Gish.jpg"
}

Result (list of objects)

faces
faceRectangle
topLeft
x
y
topRight
x
y
bottomLeft
x
y
bottomRight
x
y
landmarks
kind
x
y
emotions
happiness
anger
sadness
surprise

Example

[
  {
    "faces": [
      {
        "emotions": {
          "anger": "veryUnlikely",
          "happiness": "veryUnlikely",
          "sadness": "veryUnlikely",
          "surprise": "veryUnlikely"
        },
        "faceRectangle": {
          "bottomLeft": {
            "x": 176,
            "y": 34
          },
          "bottomRight": {
            "x": 428,
            "y": 34
          },
          "topLeft": {
            "x": 176,
            "y": 327
          },
          "topRight": {
            "x": 428,
            "y": 327
          }
        },
        "landmarks": [
          {
            "kind": "leftPupil",
            "x": 229.75856,
            "y": 174.96147
          }
        ]
      }
    ]
  }
]

Implementation details

Provider
mock
Use case
FaceDetection
Author
@superface
Source
Verified