VisionFaceDetection vision.face-detection@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
vision
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/vision/face-detection.v1.json

vision.face-detection@1: POST /api/v1/faces/detect, an identity-free YuNet privacy tool. It counts faces and returns their boxes and scores; it stores no template, names no one and needs no consent. Anyone may use it.

Fields

FieldTypeRequiredDescriptionConstraints
countintegeryes
  • minimum 0
boxesarray of objectyes
  • items: no other fields
boxes[].xnumberyes
boxes[].ynumberyes
boxes[].widthnumberyes
boxes[].heightnumberyes
boxes[].scorenumberyes
  • minimum 0
  • maximum 1

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: one
{
  "count": 1,
  "boxes": [
    {
      "x": 20,
      "y": 20,
      "width": 80,
      "height": 80,
      "score": 0.99
    }
  ]
}
Rejected: one
{
  "count": 1,
  "boxes": [
    {
      "x": 20,
      "y": 20,
      "width": 80,
      "height": 80,
      "score": 2
    }
  ]
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('vision.face-detection@1', value);   // { valid, errors: [{ path, message }] }