For the complete documentation index, see llms.txt. This page is also available as Markdown.

Predictions

The prediction document, from its top-level fields down to each kind of result

A prediction is what a Pop found in one image, or in one frame of a video. A single image gets one prediction. A video or a live stream gets one for every frame the Pop processes, in order, as they are ready.

The Pop below finds people, looks for a face on each person, and reads the expression of each face. On the lobby image from the Response Format overview it returns this prediction, shortened here to its essentials:

{
  "source_id": "1e5c1e5c-d4a7-11f1-9dc3-4e4f5a7da4bd",
  "source_width": 1280,
  "source_height": 720,
  "timestamp": 0,
  "seconds": 0,
  "objects": [
    {
      "classLabel": "person",
      "confidence": 0.9775,
      "x": 503.281, "y": 251.718, "width": 166.562, "height": 464.765,
      "objects": [
        {
          "classLabel": "face",
          "confidence": 0.7411,
          "x": 554.438, "y": 263.858, "width": 65.296, "height": 65.296,
          "classes": [
            { "classLabel": "neutral", "confidence": 0.9966 }
          ]
        }
      ]
    }
  ]
}
The person in the lobby with a box labeled person 98% around her, and inside it a smaller box around her face labeled face 74% · neutral
The prediction drawn on the image: the person, the face found within her, and the face's expression. The person is generated.

It has three layers:

  1. The source and the time — which media, how big its frame is, and when in it this is. These fields describe the prediction as a whole.

  2. The results for the whole frame — here objects, the people found in the image.

  3. The results for each object — each person carries what was found within it: the face, and on the face its expression.

The results nest as deep as the Pop does. A Pop that detects people, then faces, then expressions returns a person, holding a face, holding an expression.

Source and time

Key
Type
Meaning

source_id

string

The source this prediction belongs to. All predictions of one source share it

source_width, source_height

number

The frame's size in pixels; every position is in this frame. See Spatial Attributes

timestamp

integer

Position in the media, in nanoseconds. Always present

seconds

number

The same position in seconds, for display

duration

integer

How long this frame stands for, in nanoseconds. Videos and streams only

captured_at

integer

When the camera captured the frame, in nanoseconds since the Unix epoch. Only when the camera provides it

Temporal Attributes explains the time fields and which to use for what.

Results

A result is one thing a model found. Each kind has its own key and its own page:

Key
What it holds
Page

objects

Things found at a place: a person, a car, a face, a line of text

classes

Labels for the whole frame, or for one object: a scene type, an expression, an activity

texts

Text that was read

keyPoints

Named landmarks: the joints of a body, the corners of an eye

meshes

Dense 3D surfaces, such as a face mesh

depth

A depth map of the whole frame

raw

A model's output as plain tensors, such as an embedding vector

details

Structured JSON from an ability with a response schema

Only objects are hierarchical. An object can hold its own objects, and those theirs, to any depth: that is how a Pop that crops detections and runs further models on them reports what it found within each one. Every other kind of result is a leaf. classes, texts, keyPoints, meshes, raw and details sit on the prediction or on an object, and never hold results of their own. depth sits on the prediction only.

The same keys appear at two levels. On the prediction itself they describe the whole frame: a scene classifier puts its answer in the prediction's classes. On an object they describe that object: an expression classifier that ran on a face puts its answer in the face's classes. Which level a result lands on follows from the Pop: a component that runs on the full frame reports on the prediction, and a component that runs on a crop reports on the object it was cropped from.

Fields every result shares

Most results carry the same few descriptive fields:

Key
Type
Meaning

classLabel

string

What was found, by name: person, face, neutral, left shoulder

confidence

number

How certain the model is, from 0 to 1

category

string

The group a result belongs to: the categoryName you give its component in the Pop, or a group the ability names itself

category tells results apart when they could look alike. With categoryName="person" on the person detector, every person it finds carries "category": "person", wherever it appears in the response. Some abilities set it on their own: eyepop.image-contents:latest answers with classes such as standing, in the category human activity.

Results over time

Three keys are about the video rather than about one frame:

  • track_events — when a tracked object first appeared, and when it was last seen. See Tracks and Selected Predictions.

  • selected — true on a prediction that reports the best moment of a track, chosen after the fact. See Tracks and Selected Predictions.

  • motions — the stretch of motion this frame belongs to; see below.

Motion

With motion detection on, every prediction made while the scene is moving carries the motion it belongs to:

begin_timestamp is when the motion began, on the media's timeline. The prediction where the motion ends adds finished_timestamp. A prediction made outside a motion has no motions key.

A prediction with nothing found

A processed frame always gets a prediction, even when nothing was found in it. It then carries only the source and time:

So the number of predictions tells you how many frames were processed, and a frame with no objects is a frame where nothing was found, not one that was lost.

Example: list everything a prediction found

Because results nest, reading a prediction is a walk down its tree. This prints every object at its depth, with its labels:

Next steps

Last updated