Skip to main content

Run in Colab

Step through this example interactively
When you need answers grounded in when — not just what — pass expects="clip" and Perceptron Mk1 will return one or more Clip objects with start/end timestamps citing the moments that justify the answer. Use it for sports highlights, robot-task success/failure labeling, compliance event detection, and any workflow that turns long video into structured temporal signal.

Basic usage

Parameters: Returns: PerceiveResult object:
  • text (str): Natural-language answer with inline <clip> tags as the model emitted them.
  • reasoning (str | None): Chain-of-thought when reasoning=True.
  • clips (list[Clip] | None): Parsed temporal segments. Each Clip has:
    • timestamp.at (float): start in seconds.
    • timestamp.until (float | None): end in seconds, or None for a single moment.
    • mention (str | None): optional label the model attached.

Example: Find the shot

In this example we download a short basketball clip, ask Perceptron Mk1 to clip the moment the ball passes through the hoop, and inspect the returned timestamps.

Output format

The model emits self-closing <clip /> tags inline in the response. mention is an attribute (not body text), and timestamps are whitespace-separated with the literal unit seconds:
Multiple clips that share an event are typically wrapped in a <collection>, and child clips inherit the collection’s mention when their own is omitted:
Passing expects="clip" parses these tags into Clip objects exposed on result.clips, so you can iterate timestamps directly instead of parsing the tag text yourself. The full text — including any prose around the tags — remains available on result.text.

Best practices

  • Be specific about the event: “Clip the moment the ball passes through the hoop” works better than “find interesting moments.” Tight, observable predicates produce tight clips.
  • A single moment vs. a range: When clip.timestamp.until is None, the model is pointing at a single instant rather than a span. Both are valid; treat the moment case as “approximate point in time” rather than “zero-length range.”
Run through the full Jupyter notebook here. Reach out to Perceptron support if you have questions.