Face Detection

computer-vision/face-detection@1.0.2
Supported by 1 provider
GV

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

npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

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

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