VisionWatchResult vision.watch-result@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/watch-result.v1.json

vision.watch-result@1: POST /api/v1/watch answers the requested classes found in a camera still (DETR labels, snow/delivery/package through CLIP, or a histogram scene change), each with a confidence and, for an object, a box.

Fields

FieldTypeRequiredDescriptionConstraints
answerobjectyes
  • no other fields
answer.detectionsarray of objectyes
  • items: no other fields
answer.detections[].classstringyes
answer.detections[].confidencenumberyes
  • minimum 0
  • maximum 1
answer.detections[].boxobject | null
answer.receiptobjectyes
  • no other fields
answer.receipt.engineenumyes
  • one of "local", "routed", "local+routed", "local+routed description"
answer.receipt.modelstring | nullyes
answer.receipt.cost_usdnumberyes
  • minimum 0
answer.receipt.msintegeryes
  • minimum 0
answer.receipt.confidencenumber | nullyes
answer.receipt.retentionstringyes

Examples

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

Valid: one
{
  "answer": {
    "detections": [
      {
        "class": "package",
        "confidence": 0.88,
        "box": {
          "x": 1,
          "y": 2,
          "width": 30,
          "height": 40
        }
      },
      {
        "class": "scene change",
        "confidence": 0.4,
        "box": null
      }
    ],
    "receipt": {
      "engine": "local",
      "model": "DETR ResNet-50 q8 + histogram",
      "cost_usd": 0,
      "ms": 80,
      "confidence": 0.88,
      "retention": "not stored"
    }
  }
}
Rejected: one
{
  "answer": {
    "detections": [
      {
        "class": "package",
        "confidence": 1.5
      }
    ],
    "receipt": {
      "engine": "local",
      "model": null,
      "cost_usd": 0,
      "ms": 1,
      "confidence": null,
      "retention": "x"
    }
  }
}

Validate

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